diff mbox

OMAPDSS: pll: NULL dereference in error handling

Message ID 20141216235442.GE31467@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Dec. 16, 2014, 11:54 p.m. UTC
The regulator_disable() doesn't accept NULL pointers.

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

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Tomi Valkeinen Dec. 17, 2014, 6:28 a.m. UTC | #1
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
diff mbox

Patch

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;