powerpc/hvsi: Avoid calculating possibly-invalid address
authorRoel Kluin <roel.kluin@gmail.com>
Thu, 6 Aug 2009 13:00:37 +0000 (13:00 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 20 Aug 2009 00:29:28 +0000 (10:29 +1000)
commit728656506447b3b349d082a7fb99445f9cb0caaa
tree191c955b70e92e8fca448c71884b41e52ac97b07
parent6826a57d1abc8ac9f59b24f1a008554c6560a995
powerpc/hvsi: Avoid calculating possibly-invalid address

Check whether index is within bounds prior to calculating a
possibly-invalid address.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Bernd Petrovitsch <bernd@firmix.at>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
drivers/char/hvsi.c