Skip to content

Commit d27e5e0

Browse files
steffen-maiermartinkpetersen
authored andcommitted
scsi: zfcp: fix missing zfcp_port reference put on -EBUSY from port_remove
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]>
1 parent cc55575 commit d27e5e0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/s390/scsi/zfcp_sysfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ static ssize_t zfcp_sysfs_port_remove_store(struct device *dev,
261261
if (atomic_read(&port->units) > 0) {
262262
retval = -EBUSY;
263263
mutex_unlock(&zfcp_sysfs_port_units_mutex);
264+
put_device(&port->dev); /* undo zfcp_get_port_by_wwpn() */
264265
goto out;
265266
}
266267
/* port is about to be removed, so no more unit_add */

0 commit comments

Comments
 (0)