]> git.baikalelectronics.ru Git - kernel.git/commit
PNP: make pnp_{port,mem,etc}_start(), et al work for invalid resources
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Fri, 27 Jun 2008 22:56:56 +0000 (16:56 -0600)
committerAndi Kleen <andi@basil.nowhere.org>
Wed, 16 Jul 2008 21:27:05 +0000 (23:27 +0200)
commitec1a1cc0f0f735f0d99fb6ea7462181d9b10000d
treeae75729ddb1cb82931d740fd6a812f295749f706
parent5bece479e341eeba6e9e3843aa88c50b839ebe6c
PNP: make pnp_{port,mem,etc}_start(), et al work for invalid resources

Some callers use pnp_port_start() and similar functions without
making sure the resource is valid.  This patch makes us fall
back to returning the initial values if the resource is not
valid or not even present.

This mostly preserves the previous behavior, where we would just
return the initial values set by pnp_init_resource_table().  The
original 2.6.25 code didn't range-check the "bar", so it would
return garbage if the bar exceeded the table size.  This code
returns sensible values instead.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
include/linux/pnp.h