lkml.org 
[lkml]   [2018]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.4 123/268] watchdog: f71808e_wdt: Fix magic close handling
    Date
    4.4-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Igor Pylypiv <igor.pylypiv@gmail.com>

    [ Upstream commit 7bd3e7b743956afbec30fb525bc3c5e22e3d475c ]

    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>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/watchdog/f71808e_wdt.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    --- a/drivers/watchdog/f71808e_wdt.c
    +++ b/drivers/watchdog/f71808e_wdt.c
    @@ -520,7 +520,8 @@ static ssize_t watchdog_write(struct fil
    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 */

    \
     
     \ /
      Last update: 2018-05-28 17:31    [W:4.716 / U:1.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site