Stanse found that when pdev is found and has no driver a reference is
leaked in pcifront_common_process. So add pci_dev_put there. For the
pdev == NULL case, pci_dev_put(NULL) is fine.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
From: Jiri Slaby <jslaby@suse.cz>
Subject: 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.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Milton Miller <miltonm@bga.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
result = PCI_ERS_RESULT_NONE;
pcidev = pci_get_bus_and_slot(bus, devfn);
- if (!pcidev || !pcidev->driver){
- dev_err(&pcidev->dev,
- "device or driver is NULL\n");
+ if (!pcidev || !pcidev->driver) {
+ pci_dev_put(pcidev);
+ dev_err(&pdev->xdev->dev, "AER device or driver is NULL\n");
return result;
}
pdrv = pcidev->driver;