diff options
author | 2024-12-05 15:19:31 +0100 | |
---|---|---|
committer | 2024-12-09 21:54:54 -0500 | |
commit | 32574fe6e19d3018a27e8003b1a75be2af584dae (patch) | |
tree | 3b9c1aabbb00bf914c0ec9da96be35f5867e6d6c | |
parent | scsi: zfcp: Correct kdoc parameter description for sending ELS and CT (diff) | |
download | wireguard-linux-32574fe6e19d3018a27e8003b1a75be2af584dae.tar.xz wireguard-linux-32574fe6e19d3018a27e8003b1a75be2af584dae.zip |
scsi: zfcp: Clarify zfcp_port refcount ownership during "link" test
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Nihar Panda <niharp@linux.ibm.com>
Link: https://lore.kernel.org/r/20241205141932.1227039-3-niharp@linux.ibm.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/s390/scsi/zfcp_fc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index d6516ab00437..1d50f463afe7 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c @@ -537,6 +537,11 @@ static void zfcp_fc_adisc_handler(void *data) /* port is still good, nothing to do */ out: atomic_andnot(ZFCP_STATUS_PORT_LINK_TEST, &port->status); + /* + * port ref comes from get_device() in zfcp_fc_test_link() and + * work item zfcp_fc_link_test_work() passes ref via + * zfcp_fc_adisc() to here, if zfcp_fc_adisc() could send ADISC + */ put_device(&port->dev); kmem_cache_free(zfcp_fc_req_cache, fc_req); } @@ -603,7 +608,7 @@ void zfcp_fc_link_test_work(struct work_struct *work) retval = zfcp_fc_adisc(port); if (retval == 0) - return; + return; /* port ref passed to zfcp_fc_adisc(), no put here */ /* send of ADISC was not possible */ atomic_andnot(ZFCP_STATUS_PORT_LINK_TEST, &port->status); |