Patch "PCI: dwc: Fix setting error return on MSI DMA mapping failure" has been added to the 5.18-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

    PCI: dwc: Fix setting error return on MSI DMA mapping failure

to the 5.18-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:
     pci-dwc-fix-setting-error-return-on-msi-dma-mapping-.patch
and it can be found in the queue-5.18 subdirectory.

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



commit 592f5f4eb9e7a75d77eec00769d29552e4b6eb78
Author: Jiantao Zhang <water.zhangjiantao@xxxxxxxxxx>
Date:   Wed Mar 9 20:01:04 2022 +0800

    PCI: dwc: Fix setting error return on MSI DMA mapping failure
    
    [ Upstream commit 88557685cd72cf0db686a4ebff3fad4365cb6071 ]
    
    When dma_mapping_error() returns error because of no enough memory,
    but dw_pcie_host_init() returns success, which will mislead the callers.
    
    Link: https://lore.kernel.org/r/30170911-0e2f-98ce-9266-70465b9073e5@xxxxxxxxxx
    Fixes: 07940c369a6b ("PCI: dwc: Fix MSI page leakage in suspend/resume")
    Signed-off-by: Jianrong Zhang <zhangjianrong5@xxxxxxxxxx>
    Signed-off-by: Jiantao Zhang <water.zhangjiantao@xxxxxxxxxx>
    Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx>
    Reviewed-by: Rob Herring <robh@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index 2fa86f32d964..9979302532b7 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -396,7 +396,8 @@ int dw_pcie_host_init(struct pcie_port *pp)
 						      sizeof(pp->msi_msg),
 						      DMA_FROM_DEVICE,
 						      DMA_ATTR_SKIP_CPU_SYNC);
-			if (dma_mapping_error(pci->dev, pp->msi_data)) {
+			ret = dma_mapping_error(pci->dev, pp->msi_data);
+			if (ret) {
 				dev_err(pci->dev, "Failed to map MSI data\n");
 				pp->msi_data = 0;
 				goto err_free_msi;



[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