Skip to contentSkip to conversation

PCI: xen-pcifront, fix potential NULL dereference

PATCH New Jiri Slaby 1 participant 1 message Nov 4, 2010

Subsystems (3)
lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 PCI: xen-pcifront, fix potential NULL dereference

Milton spotted that we dereference NULL in one fail path in pcifront_common_process. Fix that by using different device to print out an error.

Cc Milton Miller <[email protected]>
---
 drivers/pci/xen-pcifront.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/pci/xen-pcifront.c +1 -2
index f9ffc05..1a56067 100644
@@ -576,8 +576,7 @@ static pci_ers_result_t pcifront_common_process(int cmd,
 
 	pcidev = pci_get_bus_and_slot(bus, devfn);
 	if (!pcidev || !pcidev->driver) {
-		dev_err(&pcidev->dev,
-			"device or driver is NULL\n");
+		dev_err(&pdev->xdev->dev, "AER device or driver is NULL\n");
 		pci_dev_put(pcidev);
 		return result;
 	}
Signature · 1 line
1.7.3.1