Patch "uio: uio_dmem_genirq: Catch the Exception" has been added to the 5.16-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

    uio: uio_dmem_genirq: Catch the Exception

to the 5.16-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:
     uio-uio_dmem_genirq-catch-the-exception.patch
and it can be found in the queue-5.16 subdirectory.

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



commit a49d3cbe866c53f38d3e20489c9404a6dc72b3c5
Author: Jiasheng Jiang <jiasheng@xxxxxxxxxxx>
Date:   Sat Dec 4 08:03:26 2021 +0800

    uio: uio_dmem_genirq: Catch the Exception
    
    [ Upstream commit eec91694f927d1026974444eb6a3adccd4f1cbc2 ]
    
    The return value of dma_set_coherent_mask() is not always 0.
    To catch the exception in case that dma is not support the mask.
    
    Fixes: 0a0c3b5a24bd ("Add new uio device for dynamic memory allocation")
    Signed-off-by: Jiasheng Jiang <jiasheng@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20211204000326.1592687-1-jiasheng@xxxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/uio/uio_dmem_genirq.c b/drivers/uio/uio_dmem_genirq.c
index 6b5cfa5b06733..1106f33764047 100644
--- a/drivers/uio/uio_dmem_genirq.c
+++ b/drivers/uio/uio_dmem_genirq.c
@@ -188,7 +188,11 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
-	dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+	ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+	if (ret) {
+		dev_err(&pdev->dev, "DMA enable failed\n");
+		return ret;
+	}
 
 	priv->uioinfo = uioinfo;
 	spin_lock_init(&priv->lock);



[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