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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
CC: Neil Horman <nhorman@xxxxxxxxxxxxx>
CC: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
CC: linux-pci@xxxxxxxxxxxxxxx
CC: linux-kernel@xxxxxxxxxxxxxxx
Signed-off-by: Veaceslav Falico <vfalico@xxxxxxxxxx>
---
 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-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux