]> mj.ucw.cz Git - pciutils.git/commit
libpci: Fix intel_sanity_check() function
authorPali Rohár <pali@kernel.org>
Sun, 26 Dec 2021 22:47:03 +0000 (23:47 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 26 Dec 2021 22:50:21 +0000 (23:50 +0100)
commit1eb437a40746c1791e7248193a17f92ddbabdd21
tree0a4ea21165589f3f16a70f78c4cc773506c667fd
parentb1cff3a42f162b081ddf77fc9e075797b7aa80e5
libpci: Fix intel_sanity_check() function

Function intel_sanity_check() calls conf1_read() which access d->domain
field. But intel_sanity_check() does not initialize this field and so
conf1_read() access some random data on stack.

Tests showed that intel_sanity_check() always fails as in d->domain is
stored some non-zero number.

Fix this issue by zeroing struct pci_dev d in intel_sanity_check() as
sanity check is verifying PCI devices at domain 0.
lib/i386-ports.c