summaryrefslogtreecommitdiffstats
path: root/src/vlib/linux
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/linux')
-rw-r--r--src/vlib/linux/pci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vlib/linux/pci.c b/src/vlib/linux/pci.c
index 9661827ea0d..1a70c568176 100644
--- a/src/vlib/linux/pci.c
+++ b/src/vlib/linux/pci.c
@@ -238,7 +238,8 @@ vlib_pci_get_device_info (vlib_main_t * vm, vlib_pci_addr_t * addr,
/* 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, sizeof (di->config)) < sizeof (di->config))
+ if (read (fd, &di->config, sizeof (di->config)) <
+ sizeof (vlib_pci_config_hdr_t))
{
err = clib_error_return_unix (0, "read `%s'", f);
close (fd);