summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/linux/pci.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/vlib/linux/pci.c b/src/vlib/linux/pci.c
index 8954bccd93f..e67e651d9a8 100644
--- a/src/vlib/linux/pci.c
+++ b/src/vlib/linux/pci.c
@@ -182,10 +182,8 @@ vlib_pci_get_device_info (vlib_pci_addr_t * addr, clib_error_t ** error)
/* You can only read more that 64 bytes of config space as root; so we try to
read the full space but fall back to just the first 64 bytes. */
- if (read (fd, &di->config_data, sizeof (di->config_data)) !=
- sizeof (di->config_data)
- && read (fd, &di->config0,
- sizeof (di->config0)) != sizeof (di->config0))
+ if (read (fd, &di->config_data, sizeof (di->config_data)) <
+ sizeof (di->config0))
{
err = clib_error_return_unix (0, "read `%s'", f);
close (fd);