]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.14/floppy-check_events-callback-should-not-return-a-neg.patch
drop some duplicated patches that somehow got merged.
[thirdparty/kernel/stable-queue.git] / queue-4.14 / floppy-check_events-callback-should-not-return-a-neg.patch
CommitLineData
ecf3b270
SL
1From a596c7857398f472a258843dc4b14b75f3ae4f0a Mon Sep 17 00:00:00 2001
2From: Yufen Yu <yuyufen@huawei.com>
3Date: Tue, 29 Jan 2019 16:34:04 +0800
4Subject: floppy: check_events callback should not return a negative number
5
6[ Upstream commit 96d7cb932e826219ec41ac02e5af037ffae6098c ]
7
8floppy_check_events() is supposed to return bit flags to say which
9events occured. We should return zero to say that no event flags are
10set. Only BIT(0) and BIT(1) are used in the caller. And .check_events
11interface also expect to return an unsigned int value.
12
13However, after commit a0c80efe5956, it may return -EINTR (-4u).
14Here, both BIT(0) and BIT(1) are cleared. So this patch shouldn't
15affect runtime, but it obviously is still worth fixing.
16
17Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
18Fixes: a0c80efe5956 ("floppy: fix lock_fdc() signal handling")
19Signed-off-by: Yufen Yu <yuyufen@huawei.com>
20Signed-off-by: Jens Axboe <axboe@kernel.dk>
21Signed-off-by: Sasha Levin <sashal@kernel.org>
22---
23 drivers/block/floppy.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
27index a7f212ea17bf..3ea9c3e9acb3 100644
28--- a/drivers/block/floppy.c
29+++ b/drivers/block/floppy.c
30@@ -4079,7 +4079,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--
402.19.1
41