Patch "scsi: aic94xx: Add missing check for dma_map_single()" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    scsi: aic94xx: Add missing check for dma_map_single()

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     scsi-aic94xx-add-missing-check-for-dma_map_single.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 829c814e027bca1b9ed84dd3e145b8c0e191fab4
Author: Jiasheng Jiang <jiasheng@xxxxxxxxxxx>
Date:   Sat Jan 28 19:08:32 2023 +0800

    scsi: aic94xx: Add missing check for dma_map_single()
    
    [ Upstream commit 32fe45274edb5926abc0fac7263d9f889d02d9cf ]
    
    Add check for dma_map_single() and return error if it fails in order to
    avoid invalid DMA address.
    
    Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver")
    Link: https://lore.kernel.org/r/20230128110832.6792-1-jiasheng@xxxxxxxxxxx
    Signed-off-by: Jiasheng Jiang <jiasheng@xxxxxxxxxxx>
    Reviewed-by: Jason Yan <yanaijie@xxxxxxxxxx>
    Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/scsi/aic94xx/aic94xx_task.c b/drivers/scsi/aic94xx/aic94xx_task.c
index cdd4ab683be98..4de4bbca1f925 100644
--- a/drivers/scsi/aic94xx/aic94xx_task.c
+++ b/drivers/scsi/aic94xx/aic94xx_task.c
@@ -68,6 +68,9 @@ static int asd_map_scatterlist(struct sas_task *task,
 		dma_addr_t dma = pci_map_single(asd_ha->pcidev, p,
 						task->total_xfer_len,
 						task->data_dir);
+		if (dma_mapping_error(&asd_ha->pcidev->dev, dma))
+			return -ENOMEM;
+
 		sg_arr[0].bus_addr = cpu_to_le64((u64)dma);
 		sg_arr[0].size = cpu_to_le32(task->total_xfer_len);
 		sg_arr[0].flags |= ASD_SG_EL_LIST_EOL;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux