Commit 2d27e528 authored by William Dean's avatar William Dean Committed by Wim Van Sebroeck

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: 54e3d9b5 ("watchdog: Add support for Armada 37xx CPU watchdog")
Reported-by: default avatarHacash Robot <hacashRobot@santino.com>
Signed-off-by: default avatarWilliam Dean <williamsukatube@gmail.com>
Reviewed-by: default avatarMarek Beh=C3=BAn <kabel@kernel.org>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20220722030938.2925156-1-williamsukatube@163.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 30ebc985
...@@ -274,6 +274,8 @@ static int armada_37xx_wdt_probe(struct platform_device *pdev) ...@@ -274,6 +274,8 @@ static int armada_37xx_wdt_probe(struct platform_device *pdev)
if (!res) if (!res)
return -ENODEV; return -ENODEV;
dev->reg = devm_ioremap(&pdev->dev, res->start, resource_size(res)); dev->reg = devm_ioremap(&pdev->dev, res->start, resource_size(res));
if (!dev->reg)
return -ENOMEM;
/* init clock */ /* init clock */
dev->clk = devm_clk_get(&pdev->dev, NULL); dev->clk = devm_clk_get(&pdev->dev, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment