diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2013-05-06 13:06:56 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-05-10 10:47:53 -0400 |
commit | 8526cb114f771851d84425d85d8735a6e0816ba2 (patch) | |
tree | dabc65e70ea5ca635f9fae207da3e717f7a2bf87 /drivers/scsi/qla4xxx/ql4_os.c | |
parent | aa9f8328fc51460e15da129caf622b6560fa8c99 (diff) |
[SCSI] iscsi class, qla4xxx: fix sess/conn refcounting when find fns are used
This fixes a bug where the iscsi class/driver did not do a put_device
when a sess/conn device was found. This also simplifies the interface
by not having to pass in some arguments that were duplicated and did
not need to be exported.
Reported-by: Zhao Hongjiang <zhaohongjiang@huawei.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_os.c')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index d777332dbed8..4d231c12463e 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
@@ -5605,6 +5605,7 @@ static int qla4xxx_sysfs_ddb_add(struct Scsi_Host *shost, const char *buf, | |||
5605 | ql4_printk(KERN_ERR, ha, | 5605 | ql4_printk(KERN_ERR, ha, |
5606 | "%s: A non-persistent entry %s found\n", | 5606 | "%s: A non-persistent entry %s found\n", |
5607 | __func__, dev->kobj.name); | 5607 | __func__, dev->kobj.name); |
5608 | put_device(dev); | ||
5608 | goto exit_ddb_add; | 5609 | goto exit_ddb_add; |
5609 | } | 5610 | } |
5610 | 5611 | ||
@@ -6112,8 +6113,7 @@ qla4xxx_sysfs_ddb_get_param(struct iscsi_bus_flash_session *fnode_sess, | |||
6112 | int parent_type, parent_index = 0xffff; | 6113 | int parent_type, parent_index = 0xffff; |
6113 | int rc = 0; | 6114 | int rc = 0; |
6114 | 6115 | ||
6115 | dev = iscsi_find_flashnode_conn(fnode_sess, NULL, | 6116 | dev = iscsi_find_flashnode_conn(fnode_sess); |
6116 | iscsi_is_flashnode_conn_dev); | ||
6117 | if (!dev) | 6117 | if (!dev) |
6118 | return -EIO; | 6118 | return -EIO; |
6119 | 6119 | ||
@@ -6347,6 +6347,8 @@ qla4xxx_sysfs_ddb_get_param(struct iscsi_bus_flash_session *fnode_sess, | |||
6347 | rc = -ENOSYS; | 6347 | rc = -ENOSYS; |
6348 | break; | 6348 | break; |
6349 | } | 6349 | } |
6350 | |||
6351 | put_device(dev); | ||
6350 | return rc; | 6352 | return rc; |
6351 | } | 6353 | } |
6352 | 6354 | ||