From: Matej Vido Date: Thu, 7 Dec 2017 14:54:42 +0000 (+0100) Subject: net/szedata2: fix check of mmap return value X-Git-Tag: spdx-start~598 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a648d49e78fdbc88952903a736a9a57d6353eb43;p=dpdk.git net/szedata2: fix check of mmap return value Fixes: 9eddbdb4b094 ("szedata2: support link state operations") Cc: stable@dpdk.org Signed-off-by: Matej Vido --- 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;