]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.4/scsi-zfcp-fix-missing-zfcp_port-reference-put-on-ebusy-from-port_remove.patch
Linux 4.9.181
[thirdparty/kernel/stable-queue.git] / queue-4.4 / scsi-zfcp-fix-missing-zfcp_port-reference-put-on-ebusy-from-port_remove.patch
1 From d27e5e07f9c49bf2a6a4ef254ce531c1b4fb5a38 Mon Sep 17 00:00:00 2001
2 From: Steffen Maier <maier@linux.ibm.com>
3 Date: Thu, 23 May 2019 15:23:45 +0200
4 Subject: scsi: zfcp: fix missing zfcp_port reference put on -EBUSY from port_remove
5
6 From: Steffen Maier <maier@linux.ibm.com>
7
8 commit d27e5e07f9c49bf2a6a4ef254ce531c1b4fb5a38 upstream.
9
10 With this early return due to zfcp_unit child(ren), we don't use the
11 zfcp_port reference from the earlier zfcp_get_port_by_wwpn() anymore and
12 need to put it.
13
14 Signed-off-by: Steffen Maier <maier@linux.ibm.com>
15 Fixes: d99b601b6338 ("[SCSI] zfcp: restore refcount check on port_remove")
16 Cc: <stable@vger.kernel.org> #3.7+
17 Reviewed-by: Jens Remus <jremus@linux.ibm.com>
18 Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
19 Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21
22 ---
23 drivers/s390/scsi/zfcp_sysfs.c | 1 +
24 1 file changed, 1 insertion(+)
25
26 --- a/drivers/s390/scsi/zfcp_sysfs.c
27 +++ b/drivers/s390/scsi/zfcp_sysfs.c
28 @@ -263,6 +263,7 @@ static ssize_t zfcp_sysfs_port_remove_st
29 if (atomic_read(&port->units) > 0) {
30 retval = -EBUSY;
31 mutex_unlock(&zfcp_sysfs_port_units_mutex);
32 + put_device(&port->dev); /* undo zfcp_get_port_by_wwpn() */
33 goto out;
34 }
35 /* port is about to be removed, so no more unit_add */