From: Martin Wu Date: Fri, 29 May 2020 09:45:14 +0000 (+0800) Subject: watchdog: sunxi_wdt: fix improper error exit code X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ff01cb1ca1f9e02e54e562bb97999e4bf1726a9e;p=linux.git watchdog: sunxi_wdt: fix improper error exit code sunxi_wdt_probe() should return -ENOMEM when devm_kzalloc() fails. Signed-off-by: Martin Wu Signed-off-by: Frank Lee Acked-by: Maxime Ripard Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20200529094514.26374-1-frank@allwinnertech.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/sunxi_wdt.c b/drivers/watchdog/sunxi_wdt.c index 5f05a45ac1872..b50757882a98a 100644 --- a/drivers/watchdog/sunxi_wdt.c +++ b/drivers/watchdog/sunxi_wdt.c @@ -235,7 +235,7 @@ static int sunxi_wdt_probe(struct platform_device *pdev) sunxi_wdt = devm_kzalloc(dev, sizeof(*sunxi_wdt), GFP_KERNEL); if (!sunxi_wdt) - return -EINVAL; + return -ENOMEM; sunxi_wdt->wdt_regs = of_device_get_match_data(dev); if (!sunxi_wdt->wdt_regs)