WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] pcifront: fix PCI reference leak

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] pcifront: fix PCI reference leak
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 15 Nov 2010 01:50:05 -0800
Delivery-date: Mon, 15 Nov 2010 01:50:17 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1289813577 0
# Node ID f7dde31efff3be20157ea08bb15126aee7a8d4c2
# Parent  af8830fcf50e4abd40bf7aaf0d954e71e7e7ecdf
pcifront: fix PCI reference leak

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@xxxxxxx>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Cc: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>

From: Jiri Slaby <jslaby@xxxxxxx>
Subject: pcifront: fix potential NULL dereference

Milton spotted that we dereference NULL in one fail path in
pcifront_common_process. Fix that by using different device to print
out an error.

Signed-off-by: Jiri Slaby <jslaby@xxxxxxx>
Cc: Milton Miller <miltonm@xxxxxxx>

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 drivers/xen/pcifront/pci_op.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -r af8830fcf50e -r f7dde31efff3 drivers/xen/pcifront/pci_op.c
--- a/drivers/xen/pcifront/pci_op.c     Wed Nov 03 17:36:03 2010 +0000
+++ b/drivers/xen/pcifront/pci_op.c     Mon Nov 15 09:32:57 2010 +0000
@@ -592,9 +592,9 @@ static pci_ers_result_t pcifront_common_
        result = PCI_ERS_RESULT_NONE;
 
        pcidev = pci_get_bus_and_slot(bus, devfn);
-       if (!pcidev || !pcidev->driver){
-               dev_err(&pcidev->dev, 
-                       "device or driver is NULL\n");
+       if (!pcidev || !pcidev->driver) {
+               pci_dev_put(pcidev);
+               dev_err(&pdev->xdev->dev, "AER device or driver is NULL\n");
                return result;
        }
        pdrv = pcidev->driver;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] pcifront: fix PCI reference leak, Xen patchbot-linux-2.6.18-xen <=