From c27250d527e294753b46d45e806253387ea6d9cb Mon Sep 17 00:00:00 2001 From: Jeongtae Park Date: Tue, 12 Jun 2018 21:36:15 +0900 Subject: [PATCH] [COMMON] fimc-is2: use valid frame pointer for internal subdevs Change-Id: If3e2ef8ef676d6b7baa0dac2f36e3dc50a29f8a1 Signed-off-by: Jeongtae Park --- .../platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c index efac920c002f..248002d4ce3c 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c @@ -1115,12 +1115,9 @@ static int fimc_is_sensor_notify_by_fstr(struct fimc_is_device_sensor *device, v framemgr_x_barrier(framemgr, 0); return -EINVAL; } - frameptr = ctrl.value; - - if (frameptr < framemgr->num_frames) { - frame = &framemgr->frames[frameptr]; - frame->fcount = device->fcount; - } + frameptr = (ctrl.value + 1) % framemgr->num_frames; + frame = &framemgr->frames[frameptr]; + frame->fcount = device->fcount; } framemgr_x_barrier(framemgr, 0); -- 2.20.1