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] linux/pci_back: fix NULL pointer ref.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] linux/pci_back: fix NULL pointer ref.
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 14 Apr 2009 13:05:05 -0700
Delivery-date: Tue, 14 Apr 2009 13:05:16 -0700
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.fraser@xxxxxxxxxx>
# Date 1239704168 -3600
# Node ID 35b981251e102e114f2a0731a03e697d5a16b8d1
# Parent  e75edb8d2c441434b03d098873d0bb7d0b029c1c
linux/pci_back: fix NULL pointer ref.

pcistub_device_release() can be called during
initialization. Thus pci_get_drvdata() can return NULL.
Fix it by inserting NULL check.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 drivers/xen/pciback/conf_space.c |    6 ++++++
 1 files changed, 6 insertions(+)

diff -r e75edb8d2c44 -r 35b981251e10 drivers/xen/pciback/conf_space.c
--- a/drivers/xen/pciback/conf_space.c  Tue Apr 14 14:05:30 2009 +0900
+++ b/drivers/xen/pciback/conf_space.c  Tue Apr 14 11:16:08 2009 +0100
@@ -297,6 +297,8 @@ void pciback_config_free_dyn_fields(stru
 
        dev_dbg(&dev->dev,
                "free-ing dynamically allocated virtual configuration space 
fields\n");
+       if (!dev_data)
+               return;
 
        list_for_each_entry_safe(cfg_entry, t, &dev_data->config_fields, list) {
                field = cfg_entry->field;
@@ -321,6 +323,8 @@ void pciback_config_reset_dev(struct pci
        const struct config_field *field;
 
        dev_dbg(&dev->dev, "resetting virtual configuration space\n");
+       if (!dev_data)
+               return;
 
        list_for_each_entry(cfg_entry, &dev_data->config_fields, list) {
                field = cfg_entry->field;
@@ -337,6 +341,8 @@ void pciback_config_free_dev(struct pci_
        const struct config_field *field;
 
        dev_dbg(&dev->dev, "free-ing virtual configuration space fields\n");
+       if (!dev_data)
+               return;
 
        list_for_each_entry_safe(cfg_entry, t, &dev_data->config_fields, list) {
                list_del(&cfg_entry->list);

_______________________________________________
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] linux/pci_back: fix NULL pointer ref., Xen patchbot-linux-2.6.18-xen <=