]> git.karo-electronics.de Git - karo-tx-linux.git/commit
x86, pci, mrst: Add extra sanity check in walking the PCI extended cap chain
authorJacob Pan <jacob.jun.pan@linux.intel.com>
Fri, 16 Jul 2010 18:58:26 +0000 (11:58 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Aug 2010 17:29:56 +0000 (10:29 -0700)
commitb55e938d07d4af42af8997a78bce880b5778f41d
treee14065b032902b90e189e69e877d90b676bcbf55
parentf3cc1d7b74d0d128da2cc39cf88390ed4f95e08d
x86, pci, mrst: Add extra sanity check in walking the PCI extended cap chain

commit f82c3d71d6fd2e6a3e3416f09099e29087e39abf upstream.

The fixed bar capability structure is searched in PCI extended
configuration space.  We need to make sure there is a valid capability
ID to begin with otherwise, the search code may stuck in a infinite
loop which results in boot hang.  This patch adds additional check for
cap ID 0, which is also invalid, and indicates end of chain.

End of chain is supposed to have all fields zero, but that doesn't
seem to always be the case in the field.

Suggested-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
LKML-Reference: <1279306706-27087-1-git-send-email-jacob.jun.pan@linux.intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/pci/mrst.c