summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-02-04 21:41:13 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-02-04 21:42:21 +0000
commitf9c8e365e972bf7ec6dd690096acaa21372e9826 (patch)
treee23da4263ba107afd5cc429ff913884bb2465643 /tools
parent34c66d073919424438356befbee7bc45609fb340 (diff)
intel_error_decode: Don't barf on a malformed PCI ID line
Whoops, someone added UTS_RELEASE with no newline before PCI ID which upsets our naive parser.
Diffstat (limited to 'tools')
-rw-r--r--tools/intel_error_decode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c
index ca03c835..56bb9847 100644
--- a/tools/intel_error_decode.c
+++ b/tools/intel_error_decode.c
@@ -365,6 +365,11 @@ read_data_file (FILE *file)
matched = sscanf (line, "PCI ID: 0x%04x\n", &reg);
if (matched == 0)
matched = sscanf (line, " PCI ID: 0x%04x\n", &reg);
+ if (matched == 0) {
+ const char *pci_id_start = strstr (line, "PCI ID");
+ if (pci_id_start)
+ matched = sscanf (pci_id_start, "PCI ID: 0x%04x\n", &reg);
+ }
if (matched == 1) {
devid = reg;
printf("Detected GEN%i chipset\n",