]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
Stop early if the VPD is corrupt
authorMatthew Wilcox <matthew@wil.cx>
Wed, 13 May 2009 21:44:46 +0000 (15:44 -0600)
committerMartin Mares <mj@ucw.cz>
Sat, 4 Jul 2009 13:31:16 +0000 (15:31 +0200)
I have several cards which report more-or-less garbage in their VPD.
It can take an extraordinarily long time to read all their VPD and none
of it is of interest.  Instead, if we find an unknown resource type,
just stop trying to read any more.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
ls-vpd.c

index a1696ee967fad36466d6bd581e2cd74b09511158..6ded2d8ed3ad9db6a1b55550bac01a68cdd0d601 100644 (file)
--- a/ls-vpd.c
+++ b/ls-vpd.c
@@ -198,7 +198,7 @@ cap_vpd(struct device *d)
        default:
          printf("\t\tUnknown %s resource type %02x\n",
                 (tag & 0x80) ? "large" : "small", tag & ~0x80);
-         break;
+         return;
        }
 
       res_addr += res_len;