On Fri, Jun 17, 2016 at 05:11:35PM +0000, weiyj_lk@xxxxxxx wrote: > From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx> > > In case of error, the function devm_kzalloc() 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@xxxxxxxxxxxxxxxxx> Good catch. Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx> > --- > drivers/watchdog/pic32-wdt.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/watchdog/pic32-wdt.c b/drivers/watchdog/pic32-wdt.c > index 6047aa8..2b7a2b2 100644 > --- a/drivers/watchdog/pic32-wdt.c > +++ b/drivers/watchdog/pic32-wdt.c > @@ -174,8 +174,8 @@ static int pic32_wdt_drv_probe(struct platform_device *pdev) > struct resource *mem; > > wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL); > - if (IS_ERR(wdt)) > - return PTR_ERR(wdt); > + if (!wdt) > + return -ENOMEM; > > mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); > wdt->regs = devm_ioremap_resource(&pdev->dev, mem); > > > -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html