summaryrefslogtreecommitdiff
path: root/drivers/media/platform/exynos4-is/fimc-lite-reg.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2013-10-13 07:50:40 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-12-04 15:52:43 -0200
commitb1fbe051c1ff608eaab3d46cf38be03ac374294b (patch)
tree78720e6e683d00e6e5df0f55fa273f8c5b75589b /drivers/media/platform/exynos4-is/fimc-lite-reg.c
parente1163236f5214e3447f1132a355a26db3db7d9f3 (diff)
[media] exynos4-is: fimc-lite: Index out of bounds if no pixelcode found
In case no valid pixelcode is found, an i of -1 after the loop is out of bounds for the array. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform/exynos4-is/fimc-lite-reg.c')
-rw-r--r--drivers/media/platform/exynos4-is/fimc-lite-reg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/exynos4-is/fimc-lite-reg.c b/drivers/media/platform/exynos4-is/fimc-lite-reg.c
index 72a343e3b5e8..d0dc7ee04452 100644
--- a/drivers/media/platform/exynos4-is/fimc-lite-reg.c
+++ b/drivers/media/platform/exynos4-is/fimc-lite-reg.c
@@ -133,7 +133,7 @@ void flite_hw_set_source_format(struct fimc_lite *dev, struct flite_frame *f)
int i = ARRAY_SIZE(src_pixfmt_map);
u32 cfg;
- while (--i >= 0) {
+ while (--i) {
if (src_pixfmt_map[i][0] == pixelcode)
break;
}
@@ -240,7 +240,7 @@ static void flite_hw_set_out_order(struct fimc_lite *dev, struct flite_frame *f)
u32 cfg = readl(dev->regs + FLITE_REG_CIODMAFMT);
int i = ARRAY_SIZE(pixcode);
- while (--i >= 0)
+ while (--i)
if (pixcode[i][0] == f->fmt->mbus_code)
break;
cfg &= ~FLITE_REG_CIODMAFMT_YCBCR_ORDER_MASK;