lkml.org 
[lkml]   [2019]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 015/118] floppy: check_events callback should not return a negative number
    Date
    4.9-stable review patch.  If anyone has any objections, please let me know.

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

    [ Upstream commit 96d7cb932e826219ec41ac02e5af037ffae6098c ]

    floppy_check_events() is supposed to return bit flags to say which
    events occured. We should return zero to say that no event flags are
    set. Only BIT(0) and BIT(1) are used in the caller. And .check_events
    interface also expect to return an unsigned int value.

    However, after commit a0c80efe5956, it may return -EINTR (-4u).
    Here, both BIT(0) and BIT(1) are cleared. So this patch shouldn't
    affect runtime, but it obviously is still worth fixing.

    Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
    Fixes: a0c80efe5956 ("floppy: fix lock_fdc() signal handling")
    Signed-off-by: Yufen Yu <yuyufen@huawei.com>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/block/floppy.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
    index 326b9ba4518e..6914c6e1e1a8 100644
    --- a/drivers/block/floppy.c
    +++ b/drivers/block/floppy.c
    @@ -3752,7 +3752,7 @@ static unsigned int floppy_check_events(struct gendisk *disk,

    if (time_after(jiffies, UDRS->last_checked + UDP->checkfreq)) {
    if (lock_fdc(drive))
    - return -EINTR;
    + return 0;
    poll_drive(false, 0);
    process_fd_request();
    }
    --
    2.19.1


    \
     
     \ /
      Last update: 2019-03-22 14:04    [W:4.244 / U:0.132 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site