1 From 17aaefea3ff0fc6994030632b9ca9332fb174f7f Mon Sep 17 00:00:00 2001
2 From: Yufen Yu <yuyufen@huawei.com>
3 Date: Tue, 29 Jan 2019 16:34:04 +0800
4 Subject: floppy: check_events callback should not return a negative number
6 [ Upstream commit 96d7cb932e826219ec41ac02e5af037ffae6098c ]
8 floppy_check_events() is supposed to return bit flags to say which
9 events occured. We should return zero to say that no event flags are
10 set. Only BIT(0) and BIT(1) are used in the caller. And .check_events
11 interface also expect to return an unsigned int value.
13 However, after commit a0c80efe5956, it may return -EINTR (-4u).
14 Here, both BIT(0) and BIT(1) are cleared. So this patch shouldn't
15 affect runtime, but it obviously is still worth fixing.
17 Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
18 Fixes: a0c80efe5956 ("floppy: fix lock_fdc() signal handling")
19 Signed-off-by: Yufen Yu <yuyufen@huawei.com>
20 Signed-off-by: Jens Axboe <axboe@kernel.dk>
21 Signed-off-by: Sasha Levin <sashal@kernel.org>
23 drivers/block/floppy.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
26 diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
27 index fdabd0b74492..a8de56f1936d 100644
28 --- a/drivers/block/floppy.c
29 +++ b/drivers/block/floppy.c
30 @@ -4084,7 +4084,7 @@ static unsigned int floppy_check_events(struct gendisk *disk,
32 if (time_after(jiffies, UDRS->last_checked + UDP->checkfreq)) {