linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 32/38] pcie: add missing put_device call
@ 2013-12-19 15:06 Levente Kurusa
  2013-12-19 22:10 ` Bjorn Helgaas
  0 siblings, 1 reply; 4+ messages in thread
From: Levente Kurusa @ 2013-12-19 15:06 UTC (permalink / raw)
  To: LKML; +Cc: Levente Kurusa, Bjorn Helgaas, Andrew Murray, Myron Stowe,
	linux-pci

This is required so that we give up the last reference to the device.
Removed the kfree() as put_device will result in release_pcie_device being
called and hence the container of the device will be kfree'd.

Signed-off-by: Levente Kurusa <levex@linux.com>
---
 drivers/pci/pcie/portdrv_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index 08d131f..80fb1f2 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -345,7 +345,7 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq)
 
 	retval = device_register(device);
 	if (retval)
-		kfree(pcie);
+		put_device(device);
 	else
 		get_device(device);
 	return retval;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-12-20  6:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-19 15:06 [PATCH 32/38] pcie: add missing put_device call Levente Kurusa
2013-12-19 22:10 ` Bjorn Helgaas
2013-12-19 22:34   ` Greg Kroah-Hartman
2013-12-20  6:15   ` Yinghai Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).