From: Andreas Ruprecht Date: Fri, 2 Dec 2011 16:30:23 +0000 (+0100) Subject: Staging: iio/accel: Added a range check for val in store_measurement_mode() X-Git-Tag: v3.3-rc1~152^2~101^2~96 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d666c0d490d85d35fe6d6d45ba029cf16046dc82;p=pandora-kernel.git Staging: iio/accel: Added a range check for val in store_measurement_mode() 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 Acked-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed