diff options
| author | Ziyan Fu <[email protected]> | 2025-07-04 07:35:18 +0000 |
|---|---|---|
| committer | Wim Van Sebroeck <[email protected]> | 2025-07-16 16:05:02 +0000 |
| commit | 40efc43eb7ffb5a4e2f998c13b8cfb555e671b92 (patch) | |
| tree | e57204d7e1a08831c0fa23f0a1239467174a3897 /net/core/dev_api.c | |
| parent | watchdog: rti_wdt: Use of_reserved_mem_region_to_resource() for "memory-region" (diff) | |
| download | kernel-40efc43eb7ffb5a4e2f998c13b8cfb555e671b92.tar.gz kernel-40efc43eb7ffb5a4e2f998c13b8cfb555e671b92.zip | |
watchdog: iTCO_wdt: Report error if timeout configuration fails
The driver probes with the invalid timeout value when
'iTCO_wdt_set_timeout()' fails, as its return value is not checked. In
this case, when executing "wdctl", we may get:
Device: /dev/watchdog0
Timeout: 30 seconds
Timeleft: 613 seconds
The timeout value is the value of "heartbeat" or "WATCHDOG_TIMEOUT", and
the timeleft value is calculated from the register value we actually read
(0xffff) by masking with 0x3ff and converting ticks to seconds (* 6 / 10).
Add error handling to return the failure code if 'iTCO_wdt_set_timeout()'
fails, ensuring the driver probe fails and prevents invalid operation.
Signed-off-by: Ziyan Fu <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
Signed-off-by: Wim Van Sebroeck <[email protected]>
Diffstat (limited to 'net/core/dev_api.c')
0 files changed, 0 insertions, 0 deletions
