Skip to content

Commit 4645bf3

Browse files
committed
xen/pciback: Check if the device is found instead of blindly assuming 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>
1 parent 72bf809 commit 4645bf3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/xen/xen-pciback/pci_stub.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ void pcistub_put_pci_dev(struct pci_dev *dev)
220220
}
221221

222222
spin_unlock_irqrestore(&pcistub_devices_lock, flags);
223+
if (WARN_ON(!found_psdev))
224+
return;
223225

224226
/*hold this lock for avoiding breaking link between
225227
* pcistub and xen_pcibk when AER is in processing

0 commit comments

Comments
 (0)