diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2009-08-18 09:43:29 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-09-05 09:49:44 -0400 |
commit | f4395b652636398eb4712e6f3caf79c9a6c02e21 (patch) | |
tree | 178529e316a42de451f5620275b1e505c1a24145 /drivers/s390 | |
parent | 24680defdb55e073c5e43d14318a164b842d8ce7 (diff) |
[SCSI] zfcp: proper use of device register
Don't use kfree directly after device registration started.
Signed-off-by: Sebastian Ott <sebott@linux.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')
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 8e989159e4e..a7954443ec1 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -309,8 +309,10 @@ struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun) | |||
309 | } | 309 | } |
310 | read_unlock_irq(&zfcp_data.config_lock); | 310 | read_unlock_irq(&zfcp_data.config_lock); |
311 | 311 | ||
312 | if (device_register(&unit->sysfs_device)) | 312 | if (device_register(&unit->sysfs_device)) { |
313 | goto err_out_free; | 313 | put_device(&unit->sysfs_device); |
314 | return ERR_PTR(-EINVAL); | ||
315 | } | ||
314 | 316 | ||
315 | if (sysfs_create_group(&unit->sysfs_device.kobj, | 317 | if (sysfs_create_group(&unit->sysfs_device.kobj, |
316 | &zfcp_sysfs_unit_attrs)) { | 318 | &zfcp_sysfs_unit_attrs)) { |
@@ -675,8 +677,10 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn, | |||
675 | } | 677 | } |
676 | read_unlock_irq(&zfcp_data.config_lock); | 678 | read_unlock_irq(&zfcp_data.config_lock); |
677 | 679 | ||
678 | if (device_register(&port->sysfs_device)) | 680 | if (device_register(&port->sysfs_device)) { |
679 | goto err_out_free; | 681 | put_device(&port->sysfs_device); |
682 | goto err_out; | ||
683 | } | ||
680 | 684 | ||
681 | retval = sysfs_create_group(&port->sysfs_device.kobj, | 685 | retval = sysfs_create_group(&port->sysfs_device.kobj, |
682 | &zfcp_sysfs_port_attrs); | 686 | &zfcp_sysfs_port_attrs); |