watchdog: f71808e_wdt: Fix magic close handling
PATCH 1/1 watchdog: f71808e_wdt: Fix magic close handling
Watchdog close is "expected" when any byte is 'V' not just the last one. Writing "V" to the device fails because the last byte is the end of string.
$ echo V > /dev/watchdog f71808e_wdt: Unexpected close, not stopping watchdog!
Signed-off-by Igor Pylypiv <[email protected]>
--- drivers/watchdog/f71808e_wdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/watchdog/f71808e_wdt.c +2 -1
@@ -566,7 +566,8 @@ static ssize_t watchdog_write(struct file *file, const char __user *buf,char c;if (get_user (c, buf + i))return -EFAULT ; - expect_close = (c =='V' ); +if (c =='V' ) + expect_close = true; }/* Properly order writes across fork()ed processes */
Signature · 1 line
2.7.4
Quoted 7 lines · Igor Pylypiv
Watchdog close is "expected" when any byte is 'V' not just the last one. Writing "V" to the device fails because the last byte is the end of string.
$ echo V > /dev/watchdog f71808e_wdt: Unexpected close, not stopping watchdog!Signed-off-by Igor Pylypiv <[email protected]>
Reviewed-by Guenter Roeck <[email protected]>
Any volunteers to convert the driver to use the watchdog subsystem ?
Guenter
Quoted 19 lines
--- drivers/watchdog/f71808e_wdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/watchdog/f71808e_wdt.c +2
-1@@ -566,7 +566,8 @@ static ssize_t watchdog_write(struct file *file, const char __user *buf,char c;if (get_user (c, buf + i))return -EFAULT ; - expect_close = (c =='V' ); +if (c =='V' ) + expect_close = true; }/* Properly order writes across fork()ed processes */