Skip to content

Commit

Permalink
PCI: Delete unnecessary NULL pointer checks
Browse files Browse the repository at this point in the history
The pci_dev_put() function tests whether its argument is NULL and then
returns immediately.  Thus the test around the call is not needed.

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>
  • Loading branch information
Markus Elfring authored and Bjorn Helgaas committed Dec 26, 2014
1 parent 97bf6af commit 17f14b5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/pci/hotplug/cpci_hotplug_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot)

kfree(slot->hotplug_slot->info);
kfree(slot->hotplug_slot);
if (slot->dev)
pci_dev_put(slot->dev);
pci_dev_put(slot->dev);
kfree(slot);
}

Expand Down

0 comments on commit 17f14b5

Please sign in to comment.