Skip to content

Commit 2d27e52

Browse files
William DeanWim Van Sebroeck
authored andcommitted
watchdog: armada_37xx_wdt: check the return value of devm_ioremap() in armada_37xx_wdt_probe()
The function devm_ioremap() in armada_37xx_wdt_probe() can fail, so its return value should be checked. Fixes: 54e3d9b ("watchdog: Add support for Armada 37xx CPU watchdog") Reported-by: Hacash Robot <[email protected]> Signed-off-by: William Dean <[email protected]> Reviewed-by: Marek Beh=C3=BAn <[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 30ebc98 commit 2d27e52

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/watchdog/armada_37xx_wdt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ static int armada_37xx_wdt_probe(struct platform_device *pdev)
274274
if (!res)
275275
return -ENODEV;
276276
dev->reg = devm_ioremap(&pdev->dev, res->start, resource_size(res));
277+
if (!dev->reg)
278+
return -ENOMEM;
277279

278280
/* init clock */
279281
dev->clk = devm_clk_get(&pdev->dev, NULL);

0 commit comments

Comments
 (0)