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 <bhelg...@google.com>
CC: Neil Horman <nhor...@tuxdriver.com>
CC: Greg Kroah-Hartman <gre...@linuxfoundation.org>
CC: linux-...@vger.kernel.org
CC: linux-kernel@vger.kernel.org
Signed-off-by: Veaceslav Falico <vfal...@redhat.com>
---
 drivers/pci/msi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

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) {
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to