]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/floppy-check_events-callback-should-not-return-a-neg.patch
Linux 4.14.108
[thirdparty/kernel/stable-queue.git] / queue-4.19 / floppy-check_events-callback-should-not-return-a-neg.patch
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
5
6 [ Upstream commit 96d7cb932e826219ec41ac02e5af037ffae6098c ]
7
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.
12
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.
16
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>
22 ---
23 drivers/block/floppy.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
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,
31
32 if (time_after(jiffies, UDRS->last_checked + UDP->checkfreq)) {
33 if (lock_fdc(drive))
34 - return -EINTR;
35 + return 0;
36 poll_drive(false, 0);
37 process_fd_request();
38 }
39 --
40 2.19.1
41