Off by one in drivers/block/floppy.c
Subsystems (2)
PATCH 1/1 Off by one in drivers/block/floppy.c
hi,
another bug spotted by coverity (id #481). In the case that drive == N_DRIVE we acess past the drive_params array which is defined as drive_params[N_DRIVE]. By using the UDP define in the else case because UDP is &drive_params[drive]
Signed-off-by Eric Sesterhenn <[email protected]>
drivers/block/floppy.c renamed from drivers/block/floppy.c.orig +1 -1
@@ -684,7 +684,7 @@ static void __reschedule_timeout(int driif (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 ; drive =0 ; }else