Skip to content

Commit 96d7cb9

Browse files
Yufen Yuaxboe
authored andcommitted
floppy: check_events callback should not return a negative number
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 a0c80ef, 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: a0c80ef ("floppy: fix lock_fdc() signal handling") Signed-off-by: Yufen Yu <yuyufen@huawei.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent aef1897 commit 96d7cb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/block/floppy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4075,7 +4075,7 @@ static unsigned int floppy_check_events(struct gendisk *disk,
40754075

40764076
if (time_after(jiffies, UDRS->last_checked + UDP->checkfreq)) {
40774077
if (lock_fdc(drive))
4078-
return -EINTR;
4078+
return 0;
40794079
poll_drive(false, 0);
40804080
process_fd_request();
40814081
}

0 commit comments

Comments
 (0)