This driver is taking uinitialised stack gunk from the pdev[] array and
feeding it into pci_read_config_byte() and crashing when modprobed with no
hardware present.

Fix it to not index past the initialised members of pdev[].

We don't know if this driver works.


 drivers/scsi/atp870u.c |    5 +----
 1 files changed, 1 insertion(+), 4 deletions(-)

diff -puN drivers/scsi/atp870u.c~atp870u-oops-fix drivers/scsi/atp870u.c
--- 25/drivers/scsi/atp870u.c~atp870u-oops-fix	2003-10-18 00:23:10.000000000 -0700
+++ 25-akpm/drivers/scsi/atp870u.c	2003-10-18 00:27:13.000000000 -0700
@@ -2335,11 +2335,8 @@ static int atp870u_detect(Scsi_Host_Temp
 				break;
 		}
 	}
-	for (h = 0; h < MAX_ATP; h++) {
+	for (h = 0; h < card; h++) {
 		struct atp_unit tmp, *dev;
-		if (pdev[h] == NULL) {
-			return count;
-		}
 
 		/* Found an atp870u/w. */
 		base_io = pci_resource_start(pdev[h], 0);

_