From 7a66c72d6cd6617888d1e20082d923a80abff836 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Tue, 16 Feb 2016 21:37:02 +0100 Subject: [PATCH] virtio: fix check when mapping PCI resources According to the api, rte_eal_pci_map_device is only successful when returning 0. Fixes: 6ba1f63b5ab0 ("virtio: support specification 1.0") Signed-off-by: David Marchand Acked-by: Yuanhan Liu --- drivers/net/virtio/virtio_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c index 762e91c5be..b4d4476c6a 100644 --- a/drivers/net/virtio/virtio_pci.c +++ b/drivers/net/virtio/virtio_pci.c @@ -795,7 +795,7 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_hw *hw) struct virtio_pci_cap cap; int ret; - if (rte_eal_pci_map_device(dev) < 0) { + if (rte_eal_pci_map_device(dev)) { PMD_INIT_LOG(DEBUG, "failed to map pci device!"); return -1; } -- 2.20.1