mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
dmaengine: dw-edma-pcie: Reject devices without driver data
[ Upstream commit11d7cfe0c1] dw_edma_pcie_probe() treats the PCI device ID driver_data as the template for the controller layout and copies it unconditionally. A device bound dynamically via sysfs can match the driver without that data, which leads to a NULL pointer dereference. Reject such matches before enabling the device. Fixes:41aaff2a2a("dmaengine: Add Synopsys eDMA IP PCIe glue-logic") Cc: stable@vger.kernel.org Signed-off-by: Koichiro Den <den@valinux.co.jp> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260521142153.2957432-3-den@valinux.co.jp Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ac710b2f4f
commit
2733b5dcb5
@@ -165,6 +165,9 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev,
|
||||
int err, nr_irqs;
|
||||
int i, mask;
|
||||
|
||||
if (!pdata)
|
||||
return -ENODEV;
|
||||
|
||||
struct dw_edma_pcie_data *vsec_data __free(kfree) =
|
||||
kmalloc(sizeof(*vsec_data), GFP_KERNEL);
|
||||
if (!vsec_data)
|
||||
|
||||
Reference in New Issue
Block a user