net/szedata2: fix check of mmap return value
authorMatej Vido <vido@cesnet.cz>
Thu, 7 Dec 2017 14:54:42 +0000 (15:54 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jan 2018 17:47:49 +0000 (18:47 +0100)
Fixes: 9eddbdb4b094 ("szedata2: support link state operations")
Cc: stable@dpdk.org
Signed-off-by: Matej Vido <vido@cesnet.cz>
drivers/net/szedata2/rte_eth_szedata2.c

index 74f151c..af0580a 100644 (file)
@@ -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;