summaryrefslogtreecommitdiff
path: root/drivers/pci/xen-pcifront.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2014-11-10 21:02:17 -0700
committerBjorn Helgaas <bhelgaas@google.com>2014-11-10 21:02:17 -0700
commitff0387c3777f2438bad2088abe442c9f231b0be4 (patch)
tree8c3697b4a4f9474f1a9c06b2f36692d8436371a6 /drivers/pci/xen-pcifront.c
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
downloadlwn-ff0387c3777f2438bad2088abe442c9f231b0be4.tar.gz
lwn-ff0387c3777f2438bad2088abe442c9f231b0be4.zip
PCI: Delete unnecessary NULL pointer checks
The functions pci_dev_put(), pci_pme_wakeup_bus(), and put_device() return immediately if their argument is NULL. Thus the test before the call is not needed. Remove these unnecessary tests. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/xen-pcifront.c')
-rw-r--r--drivers/pci/xen-pcifront.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index 116ca3746adb..f01b26dc83a4 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -596,8 +596,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(&pdev->xdev->dev, "device or AER driver is NULL\n");
- if (pcidev)
- pci_dev_put(pcidev);
+ pci_dev_put(pcidev);
return result;
}
pdrv = pcidev->driver;