diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2018-10-24 10:11:49 +0200 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2018-10-24 10:22:25 +0200 |
commit | 44f3dd08f99ba67e967980daaea2b800c68e2659 (patch) | |
tree | 52e2cca9844787da1d9a7444544fc44bd6218c6a /README | |
parent | 13854f603f720c45caf51d785a874d3c7e8c5f58 (diff) |
linux: Set number of devices to 0 in case of error
pci_sys is a global variable which is populated on init, and in case of
error reading sysfs on Linux, the devices are NULL, but the number of
devices is left unchanged.
As a result, we may crash in `pci_device_next()` which relies on the
number of devices.
To fix the issue, simply reset the number of devices to zero in case of
error so we don't try to access indices of a NULL array later on.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions