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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Karan Tilak Kumar <[email protected]> Reviewed-by: John Menghini <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 18b5cb6 commit 85d6fbc

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
@@ -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)