summaryrefslogtreecommitdiffstats
path: root/drivers/xen/xen-pciback
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-09-29 19:12:43 +0200
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-10-19 23:01:10 +0200
commit4645bf306746106f805d2afa5330bf31df381626 (patch)
tree5cd174f16d7035b366d5293d1d35a5cc27458721 /drivers/xen/xen-pciback
parentxen/pciback: Do not dereference psdev during printk when it is NULL. (diff)
downloadlinux-4645bf306746106f805d2afa5330bf31df381626.tar.xz
linux-4645bf306746106f805d2afa5330bf31df381626.zip
xen/pciback: Check if the device is found instead of blindly assuming so.
Just in case it is not found, don't try to dereference it. [v1: Added WARN_ON, suggested by Jan Beulich <JBeulich@suse.com>] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen/xen-pciback')
-rw-r--r--drivers/xen/xen-pciback/pci_stub.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index 3cc3fbe5bf8d..8f06e1ed028c 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -220,6 +220,8 @@ void pcistub_put_pci_dev(struct pci_dev *dev)
}
spin_unlock_irqrestore(&pcistub_devices_lock, flags);
+ if (WARN_ON(!found_psdev))
+ return;
/*hold this lock for avoiding breaking link between
* pcistub and xen_pcibk when AER is in processing