From: Dan Carpenter Date: Tue, 16 Dec 2014 23:54:42 +0000 (+0300) Subject: OMAPDSS: pll: NULL dereference in error handling X-Git-Tag: firefly_0821_release~176^2~2575^2~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=811174f45f5c586569f0574ef7ff8904d5b05420;p=firefly-linux-kernel-4.4.55.git OMAPDSS: pll: NULL dereference in error handling The regulator_disable() doesn't accept NULL pointers. Signed-off-by: Dan Carpenter Signed-off-by: Tomi Valkeinen --- diff --git a/drivers/video/fbdev/omap2/dss/pll.c b/drivers/video/fbdev/omap2/dss/pll.c index 50bc62c5d367..335ffac224b9 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;