Skip to content

Commit e2358b9

Browse files
nirvannnoglitch
authored andcommitted
mfd: atmel-hlcdc: Clean invalid sys_clk pointer
In case the Device Tree provided the LVDS PLL instead of the GCK, the sys_clk pointer here was assigned a PTR_ERR. From then, further code in drivers/pwm/pwm-atmel-hlcdc.c would simply test sys_clk against NULL and treat sys_clk as valid, causing a Oops: Unable to handle kernel paging request at virtual address fffffffe [fffffffe] *pgd=6ffde861, *pte=00000000, *ppte=00000000 Internal error: Oops: 37 [#1] ARM Fixes: 3887775 ("mfd: atmel-hlcdc: Obtain essential clock for LCD operation") Signed-off-by: Aubin Constans <[email protected]>
1 parent 831ba54 commit e2358b9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/mfd/atmel-hlcdc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ static int atmel_hlcdc_probe(struct platform_device *pdev)
118118
hlcdc->sys_clk = devm_clk_get(dev, "sys_clk");
119119
if (IS_ERR(hlcdc->sys_clk)) {
120120
dev_dbg(dev, "failed to get sys_clk\n");
121+
hlcdc->sys_clk = NULL;
121122
hlcdc->lvds_pll_clk = devm_clk_get(dev, "lvds_pll_clk");
122123
if (IS_ERR(hlcdc->lvds_pll_clk)) {
123124
dev_err(dev, "failed to get GCK and LVDS_PLL\n");

0 commit comments

Comments
 (0)