]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scsi: elx: efct: Fix I/O leak on unsupported additional CDB
authorHaoxiang Li <haoxiang_li2024@163.com>
Mon, 22 Jun 2026 07:58:44 +0000 (15:58 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 13 Jul 2026 02:21:22 +0000 (22:21 -0400)
efct_dispatch_fcp_cmd() allocates an efct_io before dispatching an
unsolicited FCP command. If the command has an unsupported additional
CDB, the function returns -EIO before handing the IO to the SCSI layer.

Free the allocated IO before returning from this error path.

Fixes: f45ae6aac0a0 ("scsi: elx: efct: Unsolicited FC frame processing routines")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Link: https://patch.msgid.link/20260622075844.832871-1-haoxiang_li2024@163.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/elx/efct/efct_unsol.c

index e6addab66a6031ea9ccf65b97ac153355812e40d..6a871a59c9096750d91f7d0abb80bf9d3b273102 100644 (file)
@@ -385,6 +385,7 @@ efct_dispatch_fcp_cmd(struct efct_node *node, struct efc_hw_sequence *seq)
 
                if (cmnd->fc_flags & FCP_CFL_LEN_MASK) {
                        efc_log_err(efct, "Additional CDB not supported\n");
+                       efct_scsi_io_free(io);
                        return -EIO;
                }
                /*