Skip to content

Commit

Permalink
Off by one in floppy.c
Browse files Browse the repository at this point in the history
Another coverity patch i forgot to resend, original thread here
http://marc.info/?l=linux-kernel&m=115144559823592&w=2

In case drive == N_DRIVE, we get one past the drive_params array.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Eric Sesterhenn / Snakebyte authored and Linus Torvalds committed May 24, 2007
1 parent fa74419 commit 4acb3e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ static void __reschedule_timeout(int drive, const char *message, int marg)
if (drive == current_reqD)
drive = current_drive;
del_timer(&fd_timeout);
if (drive < 0 || drive > N_DRIVE) {
if (drive < 0 || drive >= N_DRIVE) {
fd_timeout.expires = jiffies + 20UL * HZ;
drive = 0;
} else
Expand Down

0 comments on commit 4acb3e2

Please sign in to comment.