diff options
author | Colin Ian King <colin.king@canonical.com> | 2019-07-02 12:18:35 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-29 12:21:45 +0300 |
commit | 8b87ccd33657a5c3a30b0abf348b0d19b9256627 (patch) | |
tree | 625a04bc24210c70ce4f6d4ce851f85814346fc9 | |
parent | b669c3d684d5a45279f2b712e0ddc8a27b69c2a5 (diff) | |
download | linux-8b87ccd33657a5c3a30b0abf348b0d19b9256627.tar.xz |
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>
-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 30f9ef0c0d4f..b20c575564e4 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c @@ -2499,7 +2499,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; |