diff options
author | Krzysztof Kozlowski <k.kozlowski@samsung.com> | 2013-05-27 05:56:26 -0400 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2013-06-28 08:11:48 -0400 |
commit | 37b006e88e090392cdb2787ef344193702c1d75b (patch) | |
tree | ac3f2f3d3c82adf465434cc4a5ff1ad3584ec725 /drivers/gpu/drm/exynos/exynos_drm_fimd.c | |
parent | 1586d80cbf25d5f82539fd243924763738803745 (diff) |
drm/exynos: fix tests for valid FIMD window number
Valid values for FIMD windows are from 0 to WINDOWS_NR-1
inclusive (5 windows in total). The WINDOWS_NR is also
a size of fimd_context.win_data array.
However, early-return tests for wrong values of windows
accepted a value of WINDOWS_NR which is out of bound
for fimd_context.win_data.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_fimd.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 97c61dbffd82..279c3f8c3d4e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c | |||
@@ -381,7 +381,7 @@ static void fimd_win_mode_set(struct device *dev, | |||
381 | if (win == DEFAULT_ZPOS) | 381 | if (win == DEFAULT_ZPOS) |
382 | win = ctx->default_win; | 382 | win = ctx->default_win; |
383 | 383 | ||
384 | if (win < 0 || win > WINDOWS_NR) | 384 | if (win < 0 || win >= WINDOWS_NR) |
385 | return; | 385 | return; |
386 | 386 | ||
387 | offset = overlay->fb_x * (overlay->bpp >> 3); | 387 | offset = overlay->fb_x * (overlay->bpp >> 3); |
@@ -506,7 +506,7 @@ static void fimd_win_commit(struct device *dev, int zpos) | |||
506 | if (win == DEFAULT_ZPOS) | 506 | if (win == DEFAULT_ZPOS) |
507 | win = ctx->default_win; | 507 | win = ctx->default_win; |
508 | 508 | ||
509 | if (win < 0 || win > WINDOWS_NR) | 509 | if (win < 0 || win >= WINDOWS_NR) |
510 | return; | 510 | return; |
511 | 511 | ||
512 | win_data = &ctx->win_data[win]; | 512 | win_data = &ctx->win_data[win]; |
@@ -622,7 +622,7 @@ static void fimd_win_disable(struct device *dev, int zpos) | |||
622 | if (win == DEFAULT_ZPOS) | 622 | if (win == DEFAULT_ZPOS) |
623 | win = ctx->default_win; | 623 | win = ctx->default_win; |
624 | 624 | ||
625 | if (win < 0 || win > WINDOWS_NR) | 625 | if (win < 0 || win >= WINDOWS_NR) |
626 | return; | 626 | return; |
627 | 627 | ||
628 | win_data = &ctx->win_data[win]; | 628 | win_data = &ctx->win_data[win]; |