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

Configure Feed

Select the types of activity you want to include in your feed.

watchdog: ftwdt010_wdt: fix test for platform_get_irq() failure

This code assumes that platform_get_irq() function returns zero on
failure. In fact, platform_get_irq() never returns zero. It returns
negative error codes or positive non-zero values on success.

Fixes: eca10ae6000d ("watchdog: add driver for Cortina Gemini watchdog")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/YvTgRk/ABp62/hNA@kili
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>

authored by

Dan Carpenter and committed by
Wim Van Sebroeck
695bfff5 22b455ee

+1 -1
+1 -1
drivers/watchdog/ftwdt010_wdt.c
··· 171 171 } 172 172 173 173 irq = platform_get_irq(pdev, 0); 174 - if (irq) { 174 + if (irq > 0) { 175 175 ret = devm_request_irq(dev, irq, ftwdt010_wdt_interrupt, 0, 176 176 "watchdog bark", gwdt); 177 177 if (ret)