scsi: libfc: fix null pointer dereference on a null lport
authorColin Ian King <colin.king@canonical.com>
Tue, 2 Jul 2019 09:18:35 +0000 (10:18 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 17 Jul 2019 02:32:24 +0000 (22:32 -0400)
commit41a6bf6529edd10a6def42e3b2c34a7474bcc2f5
tree1e535421115577c1c24409a712a23a31124eed2f
parent484647088826f2f651acbda6bcf9536b8a466703
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: 7414705ea4ae ("libfc: Add runtime debugging with debug_logging module parameter")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libfc/fc_exch.c