Skip to content

Commit

Permalink
xen/pciback: Check if the device is found instead of blindly assuming…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Konrad Rzeszutek Wilk committed Oct 19, 2011
1 parent 72bf809 commit 4645bf3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/xen/xen-pciback/pci_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4645bf3

Please sign in to comment.