Skip to content

Commit 32574fe

Browse files
steffen-maiermartinkpetersen
authored andcommitted
scsi: zfcp: Clarify zfcp_port refcount ownership during "link" test
Reviewed-by: Benjamin Block <[email protected]> Signed-off-by: Steffen Maier <[email protected]> Signed-off-by: Nihar Panda <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 9fe5b61 commit 32574fe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/s390/scsi/zfcp_fc.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,11 @@ static void zfcp_fc_adisc_handler(void *data)
537537
/* port is still good, nothing to do */
538538
out:
539539
atomic_andnot(ZFCP_STATUS_PORT_LINK_TEST, &port->status);
540+
/*
541+
* port ref comes from get_device() in zfcp_fc_test_link() and
542+
* work item zfcp_fc_link_test_work() passes ref via
543+
* zfcp_fc_adisc() to here, if zfcp_fc_adisc() could send ADISC
544+
*/
540545
put_device(&port->dev);
541546
kmem_cache_free(zfcp_fc_req_cache, fc_req);
542547
}
@@ -603,7 +608,7 @@ void zfcp_fc_link_test_work(struct work_struct *work)
603608

604609
retval = zfcp_fc_adisc(port);
605610
if (retval == 0)
606-
return;
611+
return; /* port ref passed to zfcp_fc_adisc(), no put here */
607612

608613
/* send of ADISC was not possible */
609614
atomic_andnot(ZFCP_STATUS_PORT_LINK_TEST, &port->status);

0 commit comments

Comments
 (0)