ChangeSet 1.1003.36.3, 2003/07/15 15:21:31-07:00, henning@meier-geinitz.de [PATCH] USB: fix check for SCN_MAX_MNR in scanner driver When checking if all minors are used don't read beyond p_scn_table (Sergey Vlasov). drivers/usb/scanner.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) diff -Nru a/drivers/usb/scanner.c b/drivers/usb/scanner.c --- a/drivers/usb/scanner.c Thu Aug 28 14:50:39 2003 +++ b/drivers/usb/scanner.c Thu Aug 28 14:50:39 2003 @@ -370,6 +370,8 @@ * 0.4.14 2003-07-15 * - Added vendor/product ids for Avision, Canon, HP, Microtek and Relisys * scanners. + * - When checking if all minors are used don't read beyond p_scn_table + * (Sergey Vlasov). * * TODO * - Performance @@ -982,7 +984,7 @@ } /* Check to make sure that the last slot isn't already taken */ - if (p_scn_table[scn_minor]) { + if (scn_minor >= SCN_MAX_MNR) { err("probe_scanner: No more minor devices remaining."); up(&scn_mutex); return NULL;