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:
parent
c453a198f6
commit
a648d49e78
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user