mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 06:01:57 +00:00
virtio/virtio_pci_legacy_dev: ensure the correct return value
When pci_iomap return NULL, the return value is zero. Signed-off-by: Peng Hao <flyingpeng@tencent.com> Link: https://lore.kernel.org/r/20211222112014.87394-1-flyingpeng@tencent.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
cf4a4493ff
commit
49814ce9e2
@ -45,8 +45,10 @@ int vp_legacy_probe(struct virtio_pci_legacy_device *ldev)
|
||||
return rc;
|
||||
|
||||
ldev->ioaddr = pci_iomap(pci_dev, 0, 0);
|
||||
if (!ldev->ioaddr)
|
||||
if (!ldev->ioaddr) {
|
||||
rc = -EIO;
|
||||
goto err_iomap;
|
||||
}
|
||||
|
||||
ldev->isr = ldev->ioaddr + VIRTIO_PCI_ISR;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user