Skip to content

Commit 3f8964a

Browse files
author
Karan Kumar
committed
scsi: fnic: Fix missing DMA mapping error in fnic_send_frame()
JIRA: https://issues.redhat.com/browse/RHEL-90133 dma_map_XXX() can fail and should be tested for errors with dma_mapping_error(). Fixes: a63e78e ("scsi: fnic: Add support for fabric based solicited requests and responses") Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com> Link: https://lore.kernel.org/r/20250618065715.14740-2-fourier.thomas@gmail.com Reviewed-by: Karan Tilak Kumar <kartilak@cisco.com> Reviewed-by: John Menghini <jmeneghi@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> (cherry picked from commit 85d6fbc) Signed-off-by: Karan Kumar <karkumar@redhat.com>
1 parent 169a56d commit 3f8964a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/scsi/fnic/fnic_fcs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,8 @@ static int fnic_send_frame(struct fnic *fnic, void *frame, int frame_len)
648648
unsigned long flags;
649649

650650
pa = dma_map_single(&fnic->pdev->dev, frame, frame_len, DMA_TO_DEVICE);
651+
if (dma_mapping_error(&fnic->pdev->dev, pa))
652+
return -ENOMEM;
651653

652654
if ((fnic_fc_trace_set_data(fnic->fnic_num,
653655
FNIC_FC_SEND | 0x80, (char *) frame,

0 commit comments

Comments
 (0)