lkml.org 
[lkml]   [2010]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] PCI: xen-pcifront, fix PCI reference leak
Date
Stanse found that when pdev is found and has no driver a reference is
leaked in pcifront_common_process. So add pci_dev_put there. For the
pdev == NULL case, pci_dev_put(NULL) is fine.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
---
drivers/pci/xen-pcifront.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index a87c498..f9ffc05 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -578,6 +578,7 @@ static pci_ers_result_t pcifront_common_process(int cmd,
if (!pcidev || !pcidev->driver) {
dev_err(&pcidev->dev,
"device or driver is NULL\n");
+ pci_dev_put(pcidev);
return result;
}
pdrv = pcidev->driver;
--
1.7.3.1



\
 
 \ /
  Last update: 2010-11-04 15:35    [W:0.031 / U:0.232 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site