Commit 1586d80c authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Inki Dae

drm/exynos: fix checks for valid mixer window

Valid values for mixer window are from 0 to MIXER_WIN_NR-1 inclusive.
Arrays in structures (e.g. mixer_context.win_data) have size of
MIXER_WIN_NR so checks for wrong mixer window must be greater-equal.
Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: default avatarHyunhee Kim <hyunhee.kim@samsung.com>
Signed-off-by: default avatarSeung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent d482e5fa
...@@ -344,7 +344,7 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos) ...@@ -344,7 +344,7 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos)
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (win < 0 || win > MIXER_WIN_NR) { if (win < 0 || win >= MIXER_WIN_NR) {
DRM_ERROR("mixer window[%d] is wrong\n", win); DRM_ERROR("mixer window[%d] is wrong\n", win);
return; return;
} }
...@@ -362,7 +362,7 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) ...@@ -362,7 +362,7 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos)
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (win < 0 || win > MIXER_WIN_NR) { if (win < 0 || win >= MIXER_WIN_NR) {
DRM_ERROR("mixer window[%d] is wrong\n", win); DRM_ERROR("mixer window[%d] is wrong\n", win);
return; return;
} }
......
...@@ -742,7 +742,7 @@ static void mixer_win_mode_set(void *ctx, ...@@ -742,7 +742,7 @@ static void mixer_win_mode_set(void *ctx,
if (win == DEFAULT_ZPOS) if (win == DEFAULT_ZPOS)
win = MIXER_DEFAULT_WIN; win = MIXER_DEFAULT_WIN;
if (win < 0 || win > MIXER_WIN_NR) { if (win < 0 || win >= MIXER_WIN_NR) {
DRM_ERROR("mixer window[%d] is wrong\n", win); DRM_ERROR("mixer window[%d] is wrong\n", win);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment