Skip to content

Commit

Permalink
scsi: zfcp: fix missing zfcp_port reference put on -EBUSY from port_r…
Browse files Browse the repository at this point in the history
…emove

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: Steffen Maier <[email protected]>
Fixes: d99b601 ("[SCSI] zfcp: restore refcount check on port_remove")
Cc: <[email protected]> #3.7+
Reviewed-by: Jens Remus <[email protected]>
Reviewed-by: Benjamin Block <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
steffen-maier authored and martinkpetersen committed May 30, 2019
1 parent cc55575 commit d27e5e0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/s390/scsi/zfcp_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ static ssize_t zfcp_sysfs_port_remove_store(struct device *dev,
if (atomic_read(&port->units) > 0) {
retval = -EBUSY;
mutex_unlock(&zfcp_sysfs_port_units_mutex);
put_device(&port->dev); /* undo zfcp_get_port_by_wwpn() */
goto out;
}
/* port is about to be removed, so no more unit_add */
Expand Down

0 comments on commit d27e5e0

Please sign in to comment.