Skip to content

Commit 41a6bf6

Browse files
Colin Ian Kingmartinkpetersen
authored andcommitted
scsi: libfc: fix null pointer dereference on a null lport
Currently if lport is null then the null lport pointer is dereference when printing out debug via the FC_LPORT_DB macro. Fix this by using the more generic FC_LIBFC_DBG debug macro instead that does not use lport. Addresses-Coverity: ("Dereference after null check") Fixes: 7414705 ("libfc: Add runtime debugging with debug_logging module parameter") Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 4846470 commit 41a6bf6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/scsi/libfc/fc_exch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2591,7 +2591,7 @@ void fc_exch_recv(struct fc_lport *lport, struct fc_frame *fp)
25912591

25922592
/* lport lock ? */
25932593
if (!lport || lport->state == LPORT_ST_DISABLED) {
2594-
FC_LPORT_DBG(lport, "Receiving frames for an lport that "
2594+
FC_LIBFC_DBG("Receiving frames for an lport that "
25952595
"has not been initialized correctly\n");
25962596
fc_frame_free(fp);
25972597
return;

0 commit comments

Comments
 (0)