Skip to content

Commit

Permalink
xen/pciback: Do not dereference psdev during printk when it is NULL.
Browse files Browse the repository at this point in the history
.. 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>
  • Loading branch information
Konrad Rzeszutek Wilk committed Oct 19, 2011
1 parent 5fbdc10 commit 72bf809
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/xen/xen-pciback/pci_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 72bf809

Please sign in to comment.