linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] OMAPDSS: pll: NULL dereference in error handling
@ 2014-12-16 23:54 Dan Carpenter
  2014-12-17  6:28 ` Tomi Valkeinen
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-12-16 23:54 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: Jean-Christophe Plagniol-Villard, linux-omap, linux-fbdev,
	kernel-janitors

The regulator_disable() doesn't accept NULL pointers.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/video/fbdev/omap2/dss/pll.c b/drivers/video/fbdev/omap2/dss/pll.c
index 50bc62c5..335ffac 100644
--- a/drivers/video/fbdev/omap2/dss/pll.c
+++ b/drivers/video/fbdev/omap2/dss/pll.c
@@ -97,7 +97,8 @@ int dss_pll_enable(struct dss_pll *pll)
 	return 0;
 
 err_enable:
-	regulator_disable(pll->regulator);
+	if (pll->regulator)
+		regulator_disable(pll->regulator);
 err_reg:
 	clk_disable_unprepare(pll->clkin);
 	return r;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] OMAPDSS: pll: NULL dereference in error handling
  2014-12-16 23:54 [patch] OMAPDSS: pll: NULL dereference in error handling Dan Carpenter
@ 2014-12-17  6:28 ` Tomi Valkeinen
  0 siblings, 0 replies; 2+ messages in thread
From: Tomi Valkeinen @ 2014-12-17  6:28 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jean-Christophe Plagniol-Villard, linux-omap, linux-fbdev,
	kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 708 bytes --]

On 17/12/14 01:54, Dan Carpenter wrote:
> The regulator_disable() doesn't accept NULL pointers.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/video/fbdev/omap2/dss/pll.c b/drivers/video/fbdev/omap2/dss/pll.c
> index 50bc62c5..335ffac 100644
> --- a/drivers/video/fbdev/omap2/dss/pll.c
> +++ b/drivers/video/fbdev/omap2/dss/pll.c
> @@ -97,7 +97,8 @@ int dss_pll_enable(struct dss_pll *pll)
>  	return 0;
>  
>  err_enable:
> -	regulator_disable(pll->regulator);
> +	if (pll->regulator)
> +		regulator_disable(pll->regulator);
>  err_reg:
>  	clk_disable_unprepare(pll->clkin);
>  	return r;
> 

Thanks! Queuing for 3.19 fbdev fixes.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-17  6:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-16 23:54 [patch] OMAPDSS: pll: NULL dereference in error handling Dan Carpenter
2014-12-17  6:28 ` Tomi Valkeinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).