Commit cfeb7972 authored by Roel Kluin's avatar Roel Kluin Committed by james toy

Check whether index is within bounds before testing the element.

Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: Willem Riede <osst@riede.org>
Cc: James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent a7d86a70
...@@ -5860,7 +5860,8 @@ static int osst_probe(struct device *dev) ...@@ -5860,7 +5860,8 @@ static int osst_probe(struct device *dev)
} }
/* find a free minor number */ /* find a free minor number */
for (i=0; os_scsi_tapes[i] && i<osst_max_dev; i++); for (i = 0; i < osst_max_dev && os_scsi_tapes[i]; i++)
;
if(i >= osst_max_dev) panic ("Scsi_devices corrupt (osst)"); if(i >= osst_max_dev) panic ("Scsi_devices corrupt (osst)");
dev_num = i; dev_num = i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment