prevent kernel oops on unknown devices
authorMatt Sealey <matt@genesi-usa.com>
Mon, 1 Nov 2010 19:02:30 +0000 (14:02 -0500)
committerMatt Sealey <matt@genesi-usa.com>
Sat, 13 Nov 2010 16:15:09 +0000 (10:15 -0600)
commit9f7220ed9a0abb6c2bca45f27d0530569c94a70e
tree129857a7191a4a750a9f828a948d38fa516e0ddd
parentde4548716511af19386f03224c98ceee0a252b0f
prevent kernel oops on unknown devices

If the returned value is outside of the range of the array, we could get
potential errors (#PF, #GF, etc), which are nasty to track down.  Instead,
report a bug, and report the value as unknown in those cases.

Thanks to Saleem Abdulrasool
drivers/power/power_supply_sysfs.c