mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
iio: magnetometer: correct a harmless off by one check
The line before limits i to 0-3 so the existing code works fine but the check is still off by one and >= is intended instead of >. Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
This commit is contained in:
parent
1e1ec2861e
commit
5517547bf4
1 changed files with 1 additions and 1 deletions
|
|
@ -308,7 +308,7 @@ static int mmc35240_read_raw(struct iio_dev *indio_dev,
|
|||
return ret;
|
||||
|
||||
i = (reg & MMC35240_CTRL1_BW_MASK) >> MMC35240_CTRL1_BW_SHIFT;
|
||||
if (i < 0 || i > ARRAY_SIZE(mmc35240_samp_freq))
|
||||
if (i < 0 || i >= ARRAY_SIZE(mmc35240_samp_freq))
|
||||
return -EINVAL;
|
||||
|
||||
*val = mmc35240_samp_freq[i];
|
||||
|
|
|
|||
Loading…
Reference in a new issue