diff options
author | Martin Wu <wuyan@allwinnertech.com> | 2020-05-29 12:45:14 +0300 |
---|---|---|
committer | Wim Van Sebroeck <wim@linux-watchdog.org> | 2020-08-05 19:42:46 +0300 |
commit | ff01cb1ca1f9e02e54e562bb97999e4bf1726a9e (patch) | |
tree | 221d312d0addb8539ef5e4170ecd3aafceab27c0 /drivers/watchdog | |
parent | 0be01476dd527dfa00976911208332c706a1b752 (diff) | |
download | linux-ff01cb1ca1f9e02e54e562bb97999e4bf1726a9e.tar.xz |
watchdog: sunxi_wdt: fix improper error exit code
sunxi_wdt_probe() should return -ENOMEM when devm_kzalloc() fails.
Signed-off-by: Martin Wu <wuyan@allwinnertech.com>
Signed-off-by: Frank Lee <frank@allwinnertech.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200529094514.26374-1-frank@allwinnertech.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/sunxi_wdt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/watchdog/sunxi_wdt.c b/drivers/watchdog/sunxi_wdt.c index 5f05a45ac187..b50757882a98 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) |