]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
xen/pciback: Check if the device is found instead of blindly assuming so.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 29 Sep 2011 17:12:43 +0000 (13:12 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 3 Oct 2011 16:19:33 +0000 (12:19 -0400)
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>
drivers/xen/xen-pciback/pci_stub.c

index c4754d5aaa8afdcb33ecc35553d293e3d891b480..7beb50582486d9b078bde45806f7310f4932b379 100644 (file)
@@ -222,6 +222,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