diff options
author | Colin Ian King <colin.king@canonical.com> | 2019-07-02 10:18:35 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-27 14:51:01 +0100 |
commit | 8ce259e5b003c0838c12752584254e310ddf3191 (patch) | |
tree | cd5a43802f1a34a2948d96f74d6f14c3814d0816 /drivers/scsi/libfc | |
parent | c55caa2bdf7f1c101faeb66c2d6bcda99dca03eb (diff) | |
download | linux-stable-8ce259e5b003c0838c12752584254e310ddf3191.tar.gz linux-stable-8ce259e5b003c0838c12752584254e310ddf3191.tar.bz2 linux-stable-8ce259e5b003c0838c12752584254e310ddf3191.zip |
scsi: libfc: fix null pointer dereference on a null lport
[ Upstream commit 41a6bf6529edd10a6def42e3b2c34a7474bcc2f5 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/scsi/libfc')
-rw-r--r-- | drivers/scsi/libfc/fc_exch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index 42bcf7f3a0f9..6ba257cbc6d9 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c @@ -2603,7 +2603,7 @@ void fc_exch_recv(struct fc_lport *lport, struct fc_frame *fp) /* lport lock ? */ if (!lport || lport->state == LPORT_ST_DISABLED) { - FC_LPORT_DBG(lport, "Receiving frames for an lport that " + FC_LIBFC_DBG("Receiving frames for an lport that " "has not been initialized correctly\n"); fc_frame_free(fp); return; |