diff mbox series

[2/2] scsi: fnic: drop unnecessary NULL check in is_fnic_fip_flogi_reject()

Message ID 20231128171352.221822-2-aleksei.kodanev@bell-sw.com
State New
Headers show
Series [1/2] scsi: message: fusion: fix array index check in mpt_sas_log_info() | expand

Commit Message

Alexey Kodanev Nov. 28, 2023, 5:13 p.m. UTC
if (desc->fip_dtype == FIP_DT_FLOGI) {
        ...
        els = (struct fip_encaps *)desc;
        fh = (struct fc_frame_header *)(els + 1);

'fh' cannot be NULL here after shifting a valid pointer 'desc'.

Detected using the static analysis tool - Svace.

Fixes: d3c995f1dcf9 ("[SCSI] fnic: FIP VLAN Discovery Feature Support")
Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
---
 drivers/scsi/fnic/fnic_fcs.c | 3 ---
 1 file changed, 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c
index 55632c67a8f2..ca4214db72f5 100644
--- a/drivers/scsi/fnic/fnic_fcs.c
+++ b/drivers/scsi/fnic/fnic_fcs.c
@@ -338,9 +338,6 @@  static inline int is_fnic_fip_flogi_reject(struct fcoe_ctlr *fip,
 		els = (struct fip_encaps *)desc;
 		fh = (struct fc_frame_header *)(els + 1);
 
-		if (!fh)
-			return 0;
-
 		/*
 		 * ELS command code, reason and explanation should be = Reject,
 		 * unsupported command and insufficient resource