Commit 66ba9b51 authored by Steffen Maier's avatar Steffen Maier Committed by Greg Kroah-Hartman

scsi: zfcp: fix missing zfcp_port reference put on -EBUSY from port_remove

commit d27e5e07 upstream.

With this early return due to zfcp_unit child(ren), we don't use the
zfcp_port reference from the earlier zfcp_get_port_by_wwpn() anymore and
need to put it.
Signed-off-by: default avatarSteffen Maier <maier@linux.ibm.com>
Fixes: d99b601b ("[SCSI] zfcp: restore refcount check on port_remove")
Cc: <stable@vger.kernel.org> #3.7+
Reviewed-by: default avatarJens Remus <jremus@linux.ibm.com>
Reviewed-by: default avatarBenjamin Block <bblock@linux.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6da1e14b
...@@ -261,6 +261,7 @@ static ssize_t zfcp_sysfs_port_remove_store(struct device *dev, ...@@ -261,6 +261,7 @@ static ssize_t zfcp_sysfs_port_remove_store(struct device *dev,
if (atomic_read(&port->units) > 0) { if (atomic_read(&port->units) > 0) {
retval = -EBUSY; retval = -EBUSY;
mutex_unlock(&zfcp_sysfs_port_units_mutex); mutex_unlock(&zfcp_sysfs_port_units_mutex);
put_device(&port->dev); /* undo zfcp_get_port_by_wwpn() */
goto out; goto out;
} }
/* port is about to be removed, so no more unit_add */ /* port is about to be removed, so no more unit_add */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment