diff options
author | Colin Ian King <colin.king@canonical.com> | 2019-07-02 05:18:35 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-07-16 22:32:24 -0400 |
commit | 41a6bf6529edd10a6def42e3b2c34a7474bcc2f5 (patch) | |
tree | 1e535421115577c1c24409a712a23a31124eed2f | |
parent | 484647088826f2f651acbda6bcf9536b8a466703 (diff) |
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>
-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 025cd2ff9f65..0c87b9777c3a 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c | |||
@@ -2591,7 +2591,7 @@ void fc_exch_recv(struct fc_lport *lport, struct fc_frame *fp) | |||
2591 | 2591 | ||
2592 | /* lport lock ? */ | 2592 | /* lport lock ? */ |
2593 | if (!lport || lport->state == LPORT_ST_DISABLED) { | 2593 | 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 " |
2595 | "has not been initialized correctly\n"); | 2595 | "has not been initialized correctly\n"); |
2596 | fc_frame_free(fp); | 2596 | fc_frame_free(fp); |
2597 | return; | 2597 | return; |