aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/cciss.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 30b328aefe7d..2810dd9805a9 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1916,9 +1916,10 @@ static int cciss_add_gendisk(ctlr_info_t *h, __u32 lunid, int controller_node)
1916 } 1916 }
1917 } 1917 }
1918 h->drv[drv_index].LunID = lunid; 1918 h->drv[drv_index].LunID = lunid;
1919 if (cciss_create_ld_sysfs_entry(h, drv_index)) 1919 if (h->drv[drv_index].dev == NULL) {
1920 goto err_free_disk; 1920 if (cciss_create_ld_sysfs_entry(h, drv_index))
1921 1921 goto err_free_disk;
1922 }
1922 /* Don't need to mark this busy because nobody */ 1923 /* Don't need to mark this busy because nobody */
1923 /* else knows about this disk yet to contend */ 1924 /* else knows about this disk yet to contend */
1924 /* for access to it. */ 1925 /* for access to it. */
@@ -2145,8 +2146,10 @@ static int deregister_disk(ctlr_info_t *h, int drv_index,
2145 */ 2146 */
2146 if (h->gendisk[0] != disk) { 2147 if (h->gendisk[0] != disk) {
2147 struct request_queue *q = disk->queue; 2148 struct request_queue *q = disk->queue;
2148 if (disk->flags & GENHD_FL_UP) 2149 if (disk->flags & GENHD_FL_UP) {
2150 cciss_destroy_ld_sysfs_entry(h, drv_index);
2149 del_gendisk(disk); 2151 del_gendisk(disk);
2152 }
2150 if (q) { 2153 if (q) {
2151 blk_cleanup_queue(q); 2154 blk_cleanup_queue(q);
2152 /* Set drv->queue to NULL so that we do not try 2155 /* Set drv->queue to NULL so that we do not try
@@ -2190,7 +2193,6 @@ static int deregister_disk(ctlr_info_t *h, int drv_index,
2190 * indicate that this element of the drive 2193 * indicate that this element of the drive
2191 * array is free. 2194 * array is free.
2192 */ 2195 */
2193 cciss_destroy_ld_sysfs_entry(h, drv_index);
2194 2196
2195 if (clear_all) { 2197 if (clear_all) {
2196 /* check to see if it was the last disk */ 2198 /* check to see if it was the last disk */
@@ -4308,15 +4310,13 @@ static void __devexit cciss_remove_one(struct pci_dev *pdev)
4308 if (disk) { 4310 if (disk) {
4309 struct request_queue *q = disk->queue; 4311 struct request_queue *q = disk->queue;
4310 4312
4311 if (disk->flags & GENHD_FL_UP) 4313 if (disk->flags & GENHD_FL_UP) {
4314 cciss_destroy_ld_sysfs_entry(hba[i], j);
4312 del_gendisk(disk); 4315 del_gendisk(disk);
4316 }
4313 if (q) 4317 if (q)
4314 blk_cleanup_queue(q); 4318 blk_cleanup_queue(q);
4315 } 4319 }
4316 if (hba[i]->drv[j].dev != NULL &&
4317 (j == 0 || hba[i]->drv[j].raid_level != -1))
4318 cciss_destroy_ld_sysfs_entry(hba[i], j);
4319
4320 } 4320 }
4321 4321
4322#ifdef CONFIG_CISS_SCSI_TAPE 4322#ifdef CONFIG_CISS_SCSI_TAPE