diff options
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r-- | drivers/block/cciss.c | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 33f8341887d0..a9e33db46e68 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -1139,8 +1139,15 @@ static int revalidate_allvol(ctlr_info_t *host) | |||
1139 | 1139 | ||
1140 | for(i=0; i< NWD; i++) { | 1140 | for(i=0; i< NWD; i++) { |
1141 | struct gendisk *disk = host->gendisk[i]; | 1141 | struct gendisk *disk = host->gendisk[i]; |
1142 | if (disk->flags & GENHD_FL_UP) | 1142 | if (disk) { |
1143 | 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 | } | ||
1144 | } | 1151 | } |
1145 | 1152 | ||
1146 | /* | 1153 | /* |
@@ -1454,10 +1461,13 @@ static int deregister_disk(struct gendisk *disk, drive_info_struct *drv, | |||
1454 | * allows us to delete disk zero but keep the controller registered. | 1461 | * allows us to delete disk zero but keep the controller registered. |
1455 | */ | 1462 | */ |
1456 | if (h->gendisk[0] != disk){ | 1463 | if (h->gendisk[0] != disk){ |
1457 | if (disk->flags & GENHD_FL_UP){ | 1464 | if (disk) { |
1458 | blk_cleanup_queue(disk->queue); | 1465 | request_queue_t *q = disk->queue; |
1459 | del_gendisk(disk); | 1466 | if (disk->flags & GENHD_FL_UP) |
1460 | drv->queue = NULL; | 1467 | del_gendisk(disk); |
1468 | if (q) | ||
1469 | blk_cleanup_queue(q); | ||
1470 | put_disk(disk); | ||
1461 | } | 1471 | } |
1462 | } | 1472 | } |
1463 | 1473 | ||
@@ -3226,9 +3236,14 @@ static void __devexit cciss_remove_one (struct pci_dev *pdev) | |||
3226 | /* remove it from the disk list */ | 3236 | /* remove it from the disk list */ |
3227 | for (j = 0; j < NWD; j++) { | 3237 | for (j = 0; j < NWD; j++) { |
3228 | struct gendisk *disk = hba[i]->gendisk[j]; | 3238 | struct gendisk *disk = hba[i]->gendisk[j]; |
3229 | if (disk->flags & GENHD_FL_UP) { | 3239 | if (disk) { |
3230 | del_gendisk(disk); | 3240 | request_queue_t *q = disk->queue; |
3231 | 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); | ||
3232 | } | 3247 | } |
3233 | } | 3248 | } |
3234 | 3249 | ||