Skip to content

Commit 85d6fbc

Browse files
Thomas-fouriermartinkpetersen
authored andcommitted
scsi: fnic: Fix missing DMA mapping error in fnic_send_frame()
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>
1 parent 18b5cb6 commit 85d6fbc

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/scsi/fnic/fnic_fcs.c

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

638638
pa = dma_map_single(&fnic->pdev->dev, frame, frame_len, DMA_TO_DEVICE);
639+
if (dma_mapping_error(&fnic->pdev->dev, pa))
640+
return -ENOMEM;
639641

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

0 commit comments

Comments
 (0)