mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 00:20:32 +00:00
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 <igor.pylypiv@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
This commit is contained in:
parent
a17f4f032b
commit
7bd3e7b743
1 changed files with 2 additions and 1 deletions
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue