xen/pciback: Do not dereference psdev during printk when it is NULL.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 29 Sep 2011 17:43:28 +0000 (13:43 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 19 Oct 2011 20:58:17 +0000 (16:58 -0400)
.. instead use BUG_ON() as all the callers of the kill_domain_by_device
check for psdev.

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 1b47480..3cc3fbe 100644 (file)
@@ -512,12 +512,7 @@ static void kill_domain_by_device(struct pcistub_device *psdev)
        int err;
        char nodename[PCI_NODENAME_MAX];
 
-       if (!psdev) {
-               dev_err(&psdev->dev->dev,
-                       "device is NULL when do AER recovery/kill_domain\n");
-               return;
-       }
-
+       BUG_ON(!psdev);
        snprintf(nodename, PCI_NODENAME_MAX, "/local/domain/0/backend/pci/%d/0",
                psdev->pdev->xdev->otherend_id);