Skip to contentSkip to conversation

Encountered a Null Pointer Problem on the SCSI Layer

DISCUSSION Pete Zaitcev 3 participants 3 messages Jan 28, 2002 – Jan 30, 2002 1 message not in the archive SCSI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 12 lines
drivers/scsi/sd.c Fri Jan 25 13:57:01 2002 renamed from drivers/scsi/sd.c Fri Jan 25 14:01:07 2002 +1 -1
@@ -279,7 +279,7 @@
        target = DEVICE_NR(dev);
 
        dpnt = &rscsi_disks[target];
-       if (!dpnt)
+       if (!dpnt->device)
                return NULL;    /* No such device */
        return &dpnt->device->request_queue;
 }
Quoted 1 line

Wai Yee Peter Wong

There's one more of theese

drivers/scsi/sd.c +1 -1
@@ -302,7 +302,7 @@
 
 	dpnt = &rscsi_disks[dev];
 	if (devm >= (sd_template.dev_max << 4) ||
-	    !dpnt ||
+	    !dpnt->device ||
 	    !dpnt->device->online ||
  	    block + SCpnt->request.nr_sectors > sd[devm].nr_sects) {
 		SCSI_LOG_HLQUEUE(2, printk("Finishing %ld sectors\n", SCpnt->request.nr_sectors));

-- Pete

#2 lore raw
Quoted 27 lines · Pete Zaitcev
Quoted 12 lines
drivers/scsi/sd.c Fri Jan 25 13:57:01 2002 renamed from drivers/scsi/sd.c Fri Jan 25 14:01:07 2002 +1 -1
@@ -279,7 +279,7 @@
        target = DEVICE_NR(dev);
 
        dpnt = &rscsi_disks[target];
-       if (!dpnt)
+       if (!dpnt->device)
                return NULL;    /* No such device */
        return &dpnt->device->request_queue;
 }
Quoted 1 line

Wai Yee Peter Wong

There's one more of theese

drivers/scsi/sd.c +1 -1
@@ -302,7 +302,7 @@
 
 	dpnt = &rscsi_disks[dev];
 	if (devm >= (sd_template.dev_max << 4) ||
-	    !dpnt ||
+	    !dpnt->device ||
 	    !dpnt->device->online ||
  	    block + SCpnt->request.nr_sectors > sd[devm].nr_sects) {
 		SCSI_LOG_HLQUEUE(2, printk("Finishing %ld sectors\n", SCpnt->re
Quoted 1 line

quest.nr_sectors));

Is is possible for dpnt to be NULL here? Should perhaps be checked...

Signature · 1 line
Horst von Brand			     http://counter.li.org # 22616
#3 lore raw
In reply to a message not in the archive

Might I suggest adding the below instead of swapping it out?

-d

Quoted 12 lines
drivers/scsi/sd.c +1 -1
@@ -302,7 +302,7 @@
 
 	dpnt = &rscsi_disks[dev];
 	if (devm >= (sd_template.dev_max << 4) ||
-	    !dpnt ||
+	    !dpnt->device ||
 	    !dpnt->device->online ||
 	    block + SCpnt->request.nr_sectors > sd[devm].nr_sects) {
 		SCSI_LOG_HLQUEUE(2, printk("Finishing %ld sectors\n", SCpnt->request.nr_sectors));