Message ID | 1380204675-18238-3-git-send-email-vfalico@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show |
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) {
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(-)