diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2010-10-05 19:12:54 +0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-10-25 18:42:37 +0400 |
commit | 1a9708cd352e3b25500704daee9270d879e48199 (patch) | |
tree | 7e2ecc4a425b2389f3891c54eb1a8dff62470a28 /drivers/s390/scsi/zfcp_unit.c | |
parent | 0df138476c8306478d6e726f044868b4bccf411c (diff) | |
download | linux-1a9708cd352e3b25500704daee9270d879e48199.tar.xz |
[SCSI] zfcp: Call get_device on port before calling put_device
zfcp_unit_release calls put_device on the port. Ensure that get_device
has been called before possibly triggering the release function
through put_device or device_unregister.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_unit.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_unit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c index 1119c535a667..20796ebc33ce 100644 --- a/drivers/s390/scsi/zfcp_unit.c +++ b/drivers/s390/scsi/zfcp_unit.c @@ -142,6 +142,8 @@ int zfcp_unit_add(struct zfcp_port *port, u64 fcp_lun) return -ENOMEM; } + get_device(&port->dev); + if (device_register(&unit->dev)) { put_device(&unit->dev); return -ENOMEM; @@ -152,8 +154,6 @@ int zfcp_unit_add(struct zfcp_port *port, u64 fcp_lun) return -EINVAL; } - get_device(&port->dev); - write_lock_irq(&port->unit_list_lock); list_add_tail(&unit->list, &port->unit_list); write_unlock_irq(&port->unit_list_lock); |