From a648d49e78fdbc88952903a736a9a57d6353eb43 Mon Sep 17 00:00:00 2001 From: Matej Vido Date: Thu, 7 Dec 2017 15:54:42 +0100 Subject: [PATCH] net/szedata2: fix check of mmap return value Fixes: 9eddbdb4b094 ("szedata2: support link state operations") Cc: stable@dpdk.org Signed-off-by: Matej Vido --- drivers/net/szedata2/rte_eth_szedata2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 74f151c4ad..af0580a31b 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -1553,7 +1553,7 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev) pci_dev->mem_resource[PCI_RESOURCE_NUMBER].len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); close(fd); - if (pci_resource_ptr == NULL) { + if (pci_resource_ptr == MAP_FAILED) { RTE_LOG(ERR, PMD, "Could not mmap file %s (fd = %d)\n", rsc_filename, fd); return -EINVAL; -- 2.20.1