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

commit d27e5e07f9c49bf2a6a4ef254ce531c1b4fb5a38 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: Steffen Maier <maier@linux.ibm.com>
Fixes: d99b601 ("[SCSI] zfcp: restore refcount check on port_remove")
Cc: <stable@vger.kernel.org> Roynas-Android-Playground#3.7+
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
steffen-maier authored and pachdomenic committed Oct 7, 2023
1 parent df863f8 commit 57327db
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 @@ -264,6 +264,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 57327db

Please sign in to comment.