From: Intel Date: Fri, 8 Nov 2013 02:00:00 +0000 (+0100) Subject: pci: fix sysfs parsing for uio X-Git-Tag: spdx-start~11097 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ce1f9117b37c9490f88d1cbb54bab85bfe291dee;p=dpdk.git pci: fix sysfs parsing for uio Signed-off-by: Intel --- diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index 73c08283cd..f5c56263bf 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -524,7 +524,7 @@ pci_uio_map_resource(struct rte_pci_device *dev) /* first try uio%d */ errno = 0; uio_num = strtoull(e->d_name + shortprefix_len, &endptr, 10); - if (errno == 0 && endptr != e->d_name) { + if (errno == 0 && endptr != (e->d_name + shortprefix_len)) { rte_snprintf(dirname2, sizeof(dirname2), "%s/uio%u", dirname, uio_num); break; @@ -533,7 +533,7 @@ pci_uio_map_resource(struct rte_pci_device *dev) /* then try uio:uio%d */ errno = 0; uio_num = strtoull(e->d_name + longprefix_len, &endptr, 10); - if (errno == 0 && endptr != e->d_name) { + if (errno == 0 && endptr != (e->d_name + longprefix_len)) { rte_snprintf(dirname2, sizeof(dirname2), "%s/uio:uio%u", dirname, uio_num); break;