Ask me for precise oops scenarios, if anything is unclear.
-- Pete
diff -ur -X dontdiff linux-2.4.17-pre4/drivers/scsi/sd.c linux-2.4.17-pre4-p3/drivers/scsi/sd.c
--- linux-2.4.17-pre4/drivers/scsi/sd.c Fri Nov 9 14:05:06 2001
+++ linux-2.4.17-pre4-p3/drivers/scsi/sd.c Wed Dec 5 15:10:50 2001
@@ -1175,7 +1175,8 @@
kfree(sd_gendisks[i].de_arr);
kfree(sd_gendisks[i].flags);
}
- kfree(sd_gendisks);
+ if (sd_gendisks != &sd_gendisk)
+ kfree(sd_gendisks);
cleanup_sd_gendisks:
kfree(sd);
cleanup_sd:
@@ -1188,6 +1189,7 @@
kfree(sd_sizes);
cleanup_disks:
kfree(rscsi_disks);
+ rscsi_disks = NULL;
cleanup_devfs:
for (i = 0; i < N_USED_SD_MAJORS; i++) {
devfs_unregister_blkdev(SD_MAJOR(i), "sd");
@@ -1251,7 +1253,7 @@
if (SDp->type != TYPE_DISK && SDp->type != TYPE_MOD)
return 0;
- if (sd_template.nr_dev >= sd_template.dev_max) {
+ if (sd_template.nr_dev >= sd_template.dev_max || rscsi_disks == NULL) {
SDp->attached--;
return 1;
}
@@ -1347,6 +1349,9 @@
int i, j;
int max_p;
int start;
+
+ if (rscsi_disks == NULL)
+ return;
for (dpnt = rscsi_disks, i = 0; i < sd_template.dev_max; i++, dpnt++)
if (dpnt->device == SDp) {
diff -ur -X dontdiff linux-2.4.17-pre4/drivers/scsi/sr.c linux-2.4.17-pre4-p3/drivers/scsi/sr.c
--- linux-2.4.17-pre4/drivers/scsi/sr.c Thu Oct 25 13:58:35 2001
+++ linux-2.4.17-pre4-p3/drivers/scsi/sr.c Wed Dec 5 15:32:09 2001
@@ -542,7 +542,7 @@
if (SDp->type != TYPE_ROM && SDp->type != TYPE_WORM)
return 1;
- if (sr_template.nr_dev >= sr_template.dev_max) {
+ if (sr_template.nr_dev >= sr_template.dev_max || scsi_CDs == NULL) {
SDp->attached--;
return 1;
}
@@ -830,6 +830,7 @@
kfree(sr_sizes);
cleanup_cds:
kfree(scsi_CDs);
+ scsi_CDs = NULL;
cleanup_devfs:
devfs_unregister_blkdev(MAJOR_NR, "sr");
sr_registered--;
@@ -904,6 +905,9 @@
{
Scsi_CD *cpnt;
int i;
+
+ if (scsi_CDs == NULL)
+ return;
for (cpnt = scsi_CDs, i = 0; i < sr_template.dev_max; i++, cpnt++)
if (cpnt->device == SDp) {
-
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/