Staging: iio/accel: Added a range check for val in store_measurement_mode()
authorAndreas Ruprecht <rupran@einserver.de>
Fri, 2 Dec 2011 16:30:23 +0000 (17:30 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 8 Dec 2011 19:30:24 +0000 (11:30 -0800)
In sca3000_store_measurement_mode() we use val to and it with a mask.
This mask is only two bits long (as we are only interested in the
lowest two bits), so a value bigger than 3 was silently ignored so
far.

Now this function will return -EINVAL, if val is bigger than 3.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

No differences found