lkml.org 
[lkml]   [2002]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectEncountered a Null Pointer Problem on the SCSI Layer
From
Date
I encountered a null pointer problem on the SCSI layer when
I was testing Mingming Cao's diskio patch "diskio-stat-rq-2414"
on 2.4.14.

Mingming's patch is at http://sourceforge.net/projects/lse/.

The code in sd_find_queue() that protects against accessing a
non-existent device is not correct. The patch to fix it is given
below. Please check.

The following patch is based on the 2.4.18-pre7 code:

---------------------------------------------------------------------------
--- linux/drivers/scsi/sd.c Fri Jan 25 14:01:07 2002
+++ linux-2.4.17-diskio/drivers/scsi/sd.c Fri Jan 25 13:57:01 2002
@@ -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;
}
---------------------------------------------------------------------------
Regards,
Peter

Wai Yee Peter Wong
IBM Linux Technology Center, Performance Analysis
email: wpeter@us.ibm.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:18    [W:0.035 / U:1.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site