diff mbox

[pciutils] Stop early if the VPD is corrupt

Message ID 20090513214446.GN15360@parisc-linux.org (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Matthew Wilcox May 13, 2009, 9:44 p.m. UTC
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>
diff mbox

Patch

diff --git a/ls-vpd.c b/ls-vpd.c
index f50d7a4..1ba917f 100644
--- a/ls-vpd.c
+++ b/ls-vpd.c
@@ -204,7 +204,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;