From: Konrad Rzeszutek Wilk Date: Wed, 19 Oct 2011 17:39:47 +0000 (-0400) Subject: xen/pciback: Do not dereference psdev during printk when it is NULL. X-Git-Tag: v2.6.39-400.9.0~854^2~8^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8f0feb8c5715be162ea1367c5072f8e824781b08;p=users%2Fjedix%2Flinux-maple.git xen/pciback: Do not dereference psdev during printk when it is NULL. .. instead use BUG_ON() as all the callers of the kill_domain_by_device check for psdev. Suggested-by: Jan Beulich [v1: Rebased on top " xen/pciback: miscellaneous adjustments" causes some conflicts] Signed-off-by: Konrad Rzeszutek Wilk --- diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c index 1b474804180a..3cc3fbe5bf8d 100644 --- a/drivers/xen/xen-pciback/pci_stub.c +++ b/drivers/xen/xen-pciback/pci_stub.c @@ -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);