pci: fix sysfs parsing for uio

Signed-off-by: Intel
This commit is contained in:
Intel 2013-11-08 03:00:00 +01:00 committed by Thomas Monjalon
parent 53784a6090
commit ce1f9117b3

View File

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