Skip to contentSkip to conversation

Off by one in drivers/block/floppy.c

PATCH Pete Zaitcev 1 participant 1 message Jun 30, 2006 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Review static void __reschedule_timeout(int dri · line 688

Quoted 8 lines · Eric Sesterhenn

+++ linux-2.6.17-git11/drivers/block/floppy.c 2006-06-27 23:49:40.000000000 +0200

(quoted diff) +1 -1
@@ -684,7 +684,7 @@ static void __reschedule_timeout(int dri
 	if (drive == current_reqD)
 		drive = current_drive;
 	del_timer(&fd_timeout);
-	if (drive < 0 || drive > N_DRIVE) {
+	if (drive < 0 || drive > N_DRIVE-1) {
 		fd_timeout.expires = jiffies + 20UL * HZ;

Looks ok, although the idiom is "drive >= N_DRIVE".

-- Pete