Skip to content

Commit

Permalink
mfd: atmel-hlcdc: Clean invalid sys_clk pointer
Browse files Browse the repository at this point in the history
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 <aubin.constans@microchip.com>
  • Loading branch information
nirvann authored and noglitch committed Sep 20, 2024
1 parent 831ba54 commit e2358b9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/mfd/atmel-hlcdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ static int atmel_hlcdc_probe(struct platform_device *pdev)
hlcdc->sys_clk = devm_clk_get(dev, "sys_clk");
if (IS_ERR(hlcdc->sys_clk)) {
dev_dbg(dev, "failed to get sys_clk\n");
hlcdc->sys_clk = NULL;
hlcdc->lvds_pll_clk = devm_clk_get(dev, "lvds_pll_clk");
if (IS_ERR(hlcdc->lvds_pll_clk)) {
dev_err(dev, "failed to get GCK and LVDS_PLL\n");
Expand Down

0 comments on commit e2358b9

Please sign in to comment.