Patchwork [v2,3/3] msi: remove useless kobject_del() in free_msi_irqs()

login
register
mail settings
Submitter Veaceslav Falico
Date Sept. 26, 2013, 2:11 p.m.
Message ID <1380204675-18238-3-git-send-email-vfalico@redhat.com>
Download mbox | patch
Permalink /patch/278202/
State Changes Requested
Headers show

Comments

Veaceslav Falico - Sept. 26, 2013, 2:11 p.m.
We only need to kobject_put() on removal (which will, eventually, call
kobject_del()). kobject_del() should be implicitly used only on circular
references (per documentation), however it's not the case here.

CC: Bjorn Helgaas <bhelgaas@google.com>
CC: Neil Horman <nhorman@tuxdriver.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: linux-pci@vger.kernel.org
CC: linux-kernel@vger.kernel.org
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
 drivers/pci/msi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Patch

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index dafda2b..d62c468 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -384,12 +384,10 @@  static void free_msi_irqs(struct pci_dev *dev)
 		 * kobject->release will take care of freeing the entry via
 		 * msi_kobj_release().
 		 */
-		if (entry->kobj.parent) {
-			kobject_del(&entry->kobj);
+		if (entry->kobj.parent)
 			kobject_put(&entry->kobj);
-		} else {
+		else
 			kfree(entry);
-		}
 	}
 
 	if (dev->msi_kset) {