Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: Delete unnecessary NULL pointer checks

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>

authored by

Markus Elfring and committed by
Bjorn Helgaas
17f14b51 97bf6af1

+1 -2
+1 -2
drivers/pci/hotplug/cpci_hotplug_core.c
··· 214 214 215 215 kfree(slot->hotplug_slot->info); 216 216 kfree(slot->hotplug_slot); 217 - if (slot->dev) 218 - pci_dev_put(slot->dev); 217 + pci_dev_put(slot->dev); 219 218 kfree(slot); 220 219 } 221 220