]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
lspci: Fix detection of extended capabilities
authorPali Rohár <pali@kernel.org>
Sat, 5 Mar 2022 23:22:54 +0000 (00:22 +0100)
committerPali Rohár <pali@kernel.org>
Fri, 15 Apr 2022 22:01:13 +0000 (00:01 +0200)
Bus may report all-ones when trying to access non-existent extended space.
Same check is also in lib/caps.c extended space parser.

ls-ecaps.c

index 15c57a8be2a88b8a8bcb9dce0cfbf8ab8c6ec461..32a2cbcb4b0caa8da7798c8f1426ee1986d7e289 100644 (file)
@@ -1041,7 +1041,7 @@ show_ext_caps(struct device *d, int type)
       if (!config_fetch(d, where, 4))
        break;
       header = get_conf_long(d, where);
-      if (!header)
+      if (!header || header == 0xffffffff)
        break;
       id = header & 0xffff;
       version = (header >> 16) & 0xf;