aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-11-18 16:49:44 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-18 16:49:44 -0500
commitbcd039b230f738243193ef7dbb03298d967b8370 (patch)
treebec1988fa1d7f8dbcd445a82ad68c27330df03a9 /drivers
parente67b23c71cb9ee02d65a74c3858716ba2dedd554 (diff)
parent6f5a0f7c955d3567f800fa36f978758cb5b99aa2 (diff)
Merge branch 'for-linus' of git://brick.kernel.dk/data/git/linux-2.6-block
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/cciss.c40
1 files changed, 28 insertions, 12 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index e239a6c29230..a9e33db46e68 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1017,10 +1017,11 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
1017 status = -ENOMEM; 1017 status = -ENOMEM;
1018 goto cleanup1; 1018 goto cleanup1;
1019 } 1019 }
1020 if (ioc->Request.Type.Direction == XFER_WRITE && 1020 if (ioc->Request.Type.Direction == XFER_WRITE) {
1021 copy_from_user(buff[sg_used], data_ptr, sz)) { 1021 if (copy_from_user(buff[sg_used], data_ptr, sz)) {
1022 status = -ENOMEM; 1022 status = -ENOMEM;
1023 goto cleanup1; 1023 goto cleanup1;
1024 }
1024 } else { 1025 } else {
1025 memset(buff[sg_used], 0, sz); 1026 memset(buff[sg_used], 0, sz);
1026 } 1027 }
@@ -1138,8 +1139,15 @@ static int revalidate_allvol(ctlr_info_t *host)
1138 1139
1139 for(i=0; i< NWD; i++) { 1140 for(i=0; i< NWD; i++) {
1140 struct gendisk *disk = host->gendisk[i]; 1141 struct gendisk *disk = host->gendisk[i];
1141 if (disk->flags & GENHD_FL_UP) 1142 if (disk) {
1142 del_gendisk(disk); 1143 request_queue_t *q = disk->queue;
1144
1145 if (disk->flags & GENHD_FL_UP)
1146 del_gendisk(disk);
1147 if (q)
1148 blk_cleanup_queue(q);
1149 put_disk(disk);
1150 }
1143 } 1151 }
1144 1152
1145 /* 1153 /*
@@ -1453,10 +1461,13 @@ static int deregister_disk(struct gendisk *disk, drive_info_struct *drv,
1453 * allows us to delete disk zero but keep the controller registered. 1461 * allows us to delete disk zero but keep the controller registered.
1454 */ 1462 */
1455 if (h->gendisk[0] != disk){ 1463 if (h->gendisk[0] != disk){
1456 if (disk->flags & GENHD_FL_UP){ 1464 if (disk) {
1457 blk_cleanup_queue(disk->queue); 1465 request_queue_t *q = disk->queue;
1458 del_gendisk(disk); 1466 if (disk->flags & GENHD_FL_UP)
1459 drv->queue = NULL; 1467 del_gendisk(disk);
1468 if (q)
1469 blk_cleanup_queue(q);
1470 put_disk(disk);
1460 } 1471 }
1461 } 1472 }
1462 1473
@@ -3225,9 +3236,14 @@ static void __devexit cciss_remove_one (struct pci_dev *pdev)
3225 /* remove it from the disk list */ 3236 /* remove it from the disk list */
3226 for (j = 0; j < NWD; j++) { 3237 for (j = 0; j < NWD; j++) {
3227 struct gendisk *disk = hba[i]->gendisk[j]; 3238 struct gendisk *disk = hba[i]->gendisk[j];
3228 if (disk->flags & GENHD_FL_UP) { 3239 if (disk) {
3229 del_gendisk(disk); 3240 request_queue_t *q = disk->queue;
3230 blk_cleanup_queue(disk->queue); 3241
3242 if (disk->flags & GENHD_FL_UP)
3243 del_gendisk(disk);
3244 if (q)
3245 blk_cleanup_queue(q);
3246 put_disk(disk);
3231 } 3247 }
3232 } 3248 }
3233 3249