Skip to content

Commit

Permalink
drm/exynos: fix WINDOWS_NR checking to vidi driver
Browse files Browse the repository at this point in the history
This patch just checks if win_data array range is valid
or not correctly.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
  • Loading branch information
Inki Dae authored and Inki Dae committed Jun 28, 2013
1 parent 37b006e commit a7f98d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/exynos/exynos_drm_vidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ static void vidi_win_mode_set(struct device *dev,
if (win == DEFAULT_ZPOS)
win = ctx->default_win;

if (win < 0 || win > WINDOWS_NR)
if (win < 0 || win >= WINDOWS_NR)
return;

offset = overlay->fb_x * (overlay->bpp >> 3);
Expand Down Expand Up @@ -332,7 +332,7 @@ static void vidi_win_commit(struct device *dev, int zpos)
if (win == DEFAULT_ZPOS)
win = ctx->default_win;

if (win < 0 || win > WINDOWS_NR)
if (win < 0 || win >= WINDOWS_NR)
return;

win_data = &ctx->win_data[win];
Expand All @@ -356,7 +356,7 @@ static void vidi_win_disable(struct device *dev, int zpos)
if (win == DEFAULT_ZPOS)
win = ctx->default_win;

if (win < 0 || win > WINDOWS_NR)
if (win < 0 || win >= WINDOWS_NR)
return;

win_data = &ctx->win_data[win];
Expand Down

0 comments on commit a7f98d6

Please sign in to comment.