Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

watchdog: pic32-wdt: Fix return value check in pic32_wdt_drv_probe()

In case of error, the function devm_ioremap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

authored by

Wei Yongjun and committed by
Wim Van Sebroeck
cddd74db 919edd51

+2 -2
+2 -2
drivers/watchdog/pic32-wdt.c
··· 183 183 return PTR_ERR(wdt->regs); 184 184 185 185 wdt->rst_base = devm_ioremap(&pdev->dev, PIC32_BASE_RESET, 0x10); 186 - if (IS_ERR(wdt->rst_base)) 187 - return PTR_ERR(wdt->rst_base); 186 + if (!wdt->rst_base) 187 + return -ENOMEM; 188 188 189 189 wdt->clk = devm_clk_get(&pdev->dev, NULL); 190 190 if (IS_ERR(wdt->clk)) {