]>
Commit | Line | Data |
---|---|---|
ecf3b270 SL |
1 | From a596c7857398f472a258843dc4b14b75f3ae4f0a 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 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 | -- | |
40 | 2.19.1 | |
41 |