media: staging: atomisp: fix bounds checking in mt9m114_s_exposure_selection()

These clamp_t() calls are no-ops because we don't save the results.  It
leads to an array out of bounds bug.

Fixes: a49d25364d ("staging/atomisp: Add support for the Intel IPU v2")

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
Dan Carpenter 2017-08-10 08:23:34 -04:00 committed by Mauro Carvalho Chehab
parent ceb25b3cf6
commit 0b56d1c8fd
1 changed files with 4 additions and 4 deletions

View File

@ -1209,10 +1209,10 @@ static int mt9m114_s_exposure_selection(struct v4l2_subdev *sd,
return -EINVAL; return -EINVAL;
} }
clamp_t(int, win_left, 0, 4); win_left = clamp_t(int, win_left, 0, 4);
clamp_t(int, win_top, 0, 4); win_top = clamp_t(int, win_top, 0, 4);
clamp_t(int, win_right, 0, 4); win_right = clamp_t(int, win_right, 0, 4);
clamp_t(int, win_bottom, 0, 4); win_bottom = clamp_t(int, win_bottom, 0, 4);
ret = mt9m114_write_reg_array(client, mt9m114_exp_average, NO_POLLING); ret = mt9m114_write_reg_array(client, mt9m114_exp_average, NO_POLLING);
if (ret) { if (ret) {