]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
staging:iio:light: V3 fix out of bounds reg_cache[] access
authorJonathan Cameron <jic23@cam.ac.uk>
Fri, 9 Sep 2011 08:53:05 +0000 (09:53 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 9 Sep 2011 20:47:30 +0000 (13:47 -0700)
commit25d7315a19bae4c880ca25b75fe8c632b79a21b7
tree5b011b1827e5e3017c8e51dde614ba5c0d89bc2f
parent66e60413db488e4830286220152ae63d31c32a6a
staging:iio:light: V3 fix out of bounds reg_cache[] access

V3 is a straightforward forward port to teh current tree of V2.

Simple fix is to just not cache REG_TEST (offset 8).
Cache doesn't help REG_TEST anyway since we write all 8 bits exactly once
(at resume/init time).

Also fix an "off-by-one" allocation of reg_cache[] array size that
was in the original code before I touched it.

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Grant Grundler <grundler@chromium.org>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/light/isl29018.c