aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-10-29 12:16:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-10-29 12:16:01 -0400
commit61aa1620be20ddad75dde7882509bfe00148b8aa (patch)
tree0ce3d4b71d06c460f8c24347ebd8630a52000ed5 /drivers/scsi
parentd4f452f8259086028aa17d495deb735e056188f4 (diff)
parent9e820afd0c4f3c8e8894aa91f5671fd7d11a787b (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: [SCSI] zfcp: Flush SCSI registration work when adding unit [SCSI] zfcp: Fix timer initialization for ct and els requests [SCSI] zfcp: Warn about storage devices with broken PLOGI data [SCSI] zfcp: Handle WWPN mismatch in PLOGI payload [SCSI] zfcp: fix kfree handling in zfcp_init_device_setup [SCSI] fix memory leak in initialization
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/scsi_scan.c2
-rw-r--r--drivers/scsi/scsi_sysfs.c7
2 files changed, 4 insertions, 5 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index c44783801402..0547a7f44d42 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -317,6 +317,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
317out_device_destroy: 317out_device_destroy:
318 scsi_device_set_state(sdev, SDEV_DEL); 318 scsi_device_set_state(sdev, SDEV_DEL);
319 transport_destroy_device(&sdev->sdev_gendev); 319 transport_destroy_device(&sdev->sdev_gendev);
320 put_device(&sdev->sdev_dev);
320 put_device(&sdev->sdev_gendev); 321 put_device(&sdev->sdev_gendev);
321out: 322out:
322 if (display_failure_msg) 323 if (display_failure_msg)
@@ -957,6 +958,7 @@ static inline void scsi_destroy_sdev(struct scsi_device *sdev)
957 if (sdev->host->hostt->slave_destroy) 958 if (sdev->host->hostt->slave_destroy)
958 sdev->host->hostt->slave_destroy(sdev); 959 sdev->host->hostt->slave_destroy(sdev);
959 transport_destroy_device(&sdev->sdev_gendev); 960 transport_destroy_device(&sdev->sdev_gendev);
961 put_device(&sdev->sdev_dev);
960 put_device(&sdev->sdev_gendev); 962 put_device(&sdev->sdev_gendev);
961} 963}
962 964
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index fde54537d715..5c7eb63a19d1 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -864,10 +864,6 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
864 goto clean_device; 864 goto clean_device;
865 } 865 }
866 866
867 /* take a reference for the sdev_dev; this is
868 * released by the sdev_class .release */
869 get_device(&sdev->sdev_gendev);
870
871 /* create queue files, which may be writable, depending on the host */ 867 /* create queue files, which may be writable, depending on the host */
872 if (sdev->host->hostt->change_queue_depth) 868 if (sdev->host->hostt->change_queue_depth)
873 error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_depth_rw); 869 error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_depth_rw);
@@ -917,6 +913,7 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
917 913
918 device_del(&sdev->sdev_gendev); 914 device_del(&sdev->sdev_gendev);
919 transport_destroy_device(&sdev->sdev_gendev); 915 transport_destroy_device(&sdev->sdev_gendev);
916 put_device(&sdev->sdev_dev);
920 put_device(&sdev->sdev_gendev); 917 put_device(&sdev->sdev_gendev);
921 918
922 return error; 919 return error;
@@ -1065,7 +1062,7 @@ void scsi_sysfs_device_initialize(struct scsi_device *sdev)
1065 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); 1062 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);
1066 1063
1067 device_initialize(&sdev->sdev_dev); 1064 device_initialize(&sdev->sdev_dev);
1068 sdev->sdev_dev.parent = &sdev->sdev_gendev; 1065 sdev->sdev_dev.parent = get_device(&sdev->sdev_gendev);
1069 sdev->sdev_dev.class = &sdev_class; 1066 sdev->sdev_dev.class = &sdev_class;
1070 dev_set_name(&sdev->sdev_dev, "%d:%d:%d:%d", 1067 dev_set_name(&sdev->sdev_dev, "%d:%d:%d:%d",
1071 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); 1068 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);