Skip to contentSkip to conversation

OMAPDSS: pll: NULL dereference in error handling

PATCH In review Dan Carpenter 2 participants 2 messages Dec 16, 2014 – Dec 17, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OMAPDSS: pll: NULL dereference in error handling

The regulator_disable() doesn't accept NULL pointers.

drivers/video/fbdev/omap2/dss/pll.c +2 -1
index 50bc62c5..335ffac 100644
@@ -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;
#1 lore raw
Quoted 10 lines · Dan Carpenter

The regulator_disable() doesn't accept NULL pointers.

drivers/video/fbdev/omap2/dss/pll.c +0 -0
index 50bc62c5..335ffac 100644

drivers/video/fbdev/omap2/dss/pll.c int dss_pll_enable(struct dss_pll *pll) · line 104

Quoted 9 lines
drivers/video/fbdev/omap2/dss/pll.c +2 -1
@@ -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