patch-1.3.65 linux/drivers/scsi/53c7,8xx.c

Next file: linux/drivers/scsi/scsi.c
Previous file: linux/drivers/pci/pci.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.64/linux/drivers/scsi/53c7,8xx.c linux/drivers/scsi/53c7,8xx.c
@@ -946,6 +946,8 @@
     for (host->this_id = 0; tmp != 1; tmp >>=1, ++host->this_id);
 #else
     host->this_id = NCR53c7x0_read8(SCID_REG) & 15;
+    if (host->this_id == 0)
+	host->this_id = 7;	/* sanitize hostid---0 doesn't make sense */
     hostdata->this_id_mask = 1 << host->this_id;
 #endif
 
@@ -1879,7 +1881,7 @@
 	}
 
 	if (failed) {
-	    printk ("scsi%d : DSP = 0x%p (script at 0x%px, start at 0x%x)\n",
+	    printk ("scsi%d : DSP = 0x%p (script at 0x%p, start at 0x%x)\n",
 		host->host_no, bus_to_virt(NCR53c7x0_read32(DSP_REG)),
 		hostdata->script, start);
 	    printk ("scsi%d : DSPS = 0x%x\n", host->host_no,
@@ -5343,10 +5345,9 @@
      * to use vverify()?
      */
 
-    if ((unsigned long) insn < PAGE_SIZE || 
-	(unsigned long) insn > (high_memory - 8) || 
+    if (MAP_NR(insn) < 1 || MAP_NR(insn + 8) > MAP_NR(high_memory) || 
 	((((dcmd = (insn[0] >> 24) & 0xff) & DCMD_TYPE_MMI) == DCMD_TYPE_MMI) &&
-	(unsigned long) insn > (high_memory - 12))) {
+	MAP_NR(insn + 12) > MAP_NR(high_memory))) {
 	size = 0;
 	sprintf (buf, "%s%p: address out of range\n",
 	    prefix, insn);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this