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-devel

[Xen-devel] [PATCH 1/1] PCI: xen-pcifront, fix potential NULL dereferenc

To: jbarnes@xxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 1/1] PCI: xen-pcifront, fix potential NULL dereference
From: Jiri Slaby <jslaby@xxxxxxx>
Date: Thu, 4 Nov 2010 19:45:53 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, jirislaby@xxxxxxxxx, konrad.wilk@xxxxxxxxxx, linux-pci@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Milton Miller <miltonm@xxxxxxx>
Delivery-date: Wed, 10 Nov 2010 09:53:51 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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>
---
 drivers/pci/xen-pcifront.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index f9ffc05..1a56067 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -576,8 +576,7 @@ static pci_ers_result_t pcifront_common_process(int cmd,
 
        pcidev = pci_get_bus_and_slot(bus, devfn);
        if (!pcidev || !pcidev->driver) {
-               dev_err(&pcidev->dev,
-                       "device or driver is NULL\n");
+               dev_err(&pdev->xdev->dev, "AER device or driver is NULL\n");
                pci_dev_put(pcidev);
                return result;
        }
-- 
1.7.3.1



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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 1/1] PCI: xen-pcifront, fix potential NULL dereference, Jiri Slaby <=