Skip to content

Commit a4e2401

Browse files
Henry MartinWim Van Sebroeck
authored andcommitted
watchdog: lenovo_se30_wdt: Fix possible devm_ioremap() NULL pointer dereference in lenovo_se30_wdt_probe()
devm_ioremap() returns NULL on error. Currently, lenovo_se30_wdt_probe() does not check for this case, which results in a NULL pointer dereference. Add NULL check after devm_ioremap() to prevent this issue. Fixes: c284153 ("watchdog: lenovo_se30_wdt: Watchdog driver for Lenovo SE30 platform") Signed-off-by: Henry Martin <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent 53663d2 commit a4e2401

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/watchdog/lenovo_se30_wdt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ static int lenovo_se30_wdt_probe(struct platform_device *pdev)
271271
return -EBUSY;
272272

273273
priv->shm_base_addr = devm_ioremap(dev, base_phys, SHM_WIN_SIZE);
274+
if (!priv->shm_base_addr)
275+
return -ENOMEM;
274276

275277
priv->wdt_cfg.mod = WDT_MODULE;
276278
priv->wdt_cfg.idx = WDT_CFG_INDEX;

0 commit comments

Comments
 (0)