diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2009-08-18 15:43:29 +0200 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-09-05 08:49:44 -0500 |
commit | f4395b652636398eb4712e6f3caf79c9a6c02e21 (patch) | |
tree | 178529e316a42de451f5620275b1e505c1a24145 /drivers/s390/scsi | |
parent | 24680defdb55e073c5e43d14318a164b842d8ce7 (diff) | |
download | op-kernel-dev-f4395b652636398eb4712e6f3caf79c9a6c02e21.zip op-kernel-dev-f4395b652636398eb4712e6f3caf79c9a6c02e21.tar.gz |
[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/scsi')
-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 8e989159..a795444 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) } read_unlock_irq(&zfcp_data.config_lock); - if (device_register(&unit->sysfs_device)) - goto err_out_free; + if (device_register(&unit->sysfs_device)) { + put_device(&unit->sysfs_device); + return ERR_PTR(-EINVAL); + } if (sysfs_create_group(&unit->sysfs_device.kobj, &zfcp_sysfs_unit_attrs)) { @@ -675,8 +677,10 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn, } read_unlock_irq(&zfcp_data.config_lock); - if (device_register(&port->sysfs_device)) - goto err_out_free; + if (device_register(&port->sysfs_device)) { + put_device(&port->sysfs_device); + goto err_out; + } retval = sysfs_create_group(&port->sysfs_device.kobj, &zfcp_sysfs_port_attrs); |