net/szedata2: fix check of mmap return value

Fixes: 9eddbdb4b094 ("szedata2: support link state operations")
Cc: stable@dpdk.org

Signed-off-by: Matej Vido <vido@cesnet.cz>
This commit is contained in:
Matej Vido 2017-12-07 15:54:42 +01:00 committed by Ferruh Yigit
parent c453a198f6
commit a648d49e78

View 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;