diff -u lshw-02.12.01/debian/changelog lshw-02.12.01/debian/changelog --- lshw-02.12.01/debian/changelog +++ lshw-02.12.01/debian/changelog @@ -1,3 +1,10 @@ +lshw (02.12.01-2ubuntu2) hardy; urgency=low + + * Add 10-cap-detection.dpatch: fixes hang when reading capabilities of some + PCI devies (LP: #202460) + + -- Brian Murray Mon, 21 Apr 2008 18:27:43 -0700 + lshw (02.12.01-2ubuntu1) hardy; urgency=low * Add 09-lshw-privacy.dpatch: disable lshw's check for updated versions diff -u lshw-02.12.01/debian/patches/00list lshw-02.12.01/debian/patches/00list --- lshw-02.12.01/debian/patches/00list +++ lshw-02.12.01/debian/patches/00list @@ -8,0 +9 @@ +10-cap-detection.dpatch only in patch2: unchanged: --- lshw-02.12.01.orig/debian/patches/10-cap-detection.dpatch +++ lshw-02.12.01/debian/patches/10-cap-detection.dpatch @@ -0,0 +1,38 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## cap-detection.dpatch by Brian Murray +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad lshw-02.12.01~/src/core/pci.cc lshw-02.12.01/src/core/pci.cc +--- lshw-02.12.01~/src/core/pci.cc 2008-04-21 18:25:20.000000000 -0700 ++++ lshw-02.12.01/src/core/pci.cc 2008-04-21 18:26:16.000000000 -0700 +@@ -68,6 +68,7 @@ + #define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ + #define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */ + #define PCI_CAP_SIZEOF 4 ++#define PCI_FIND_CAP_TTL 48 + + #define PCI_SID_ESR 2 /* Expansion Slot Register */ + #define PCI_SID_ESR_NSLOTS 0x1f /* Number of expansion slots available */ +@@ -666,8 +667,9 @@ + { + unsigned int where = get_conf_byte(d, PCI_CAPABILITY_LIST) & ~3; + string buffer; ++ unsigned int ttl = PCI_FIND_CAP_TTL; + +- while(where) ++ while(where && ttl--) + { + unsigned int id, next, cap; + +@@ -675,7 +677,7 @@ + next = get_conf_byte(d, where + PCI_CAP_LIST_NEXT) & ~3; + cap = get_conf_word(d, where + PCI_CAP_FLAGS); + +- if(!id) ++ if(!id || id == 0xff) + return false; + + switch(id)