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>
This commit is contained in:
parent
1586d80cbf
commit
37b006e88e
|
@ -381,7 +381,7 @@ static void fimd_win_mode_set(struct device *dev,
|
||||||
if (win == DEFAULT_ZPOS)
|
if (win == DEFAULT_ZPOS)
|
||||||
win = ctx->default_win;
|
win = ctx->default_win;
|
||||||
|
|
||||||
if (win < 0 || win > WINDOWS_NR)
|
if (win < 0 || win >= WINDOWS_NR)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
offset = overlay->fb_x * (overlay->bpp >> 3);
|
offset = overlay->fb_x * (overlay->bpp >> 3);
|
||||||
|
@ -506,7 +506,7 @@ static void fimd_win_commit(struct device *dev, int zpos)
|
||||||
if (win == DEFAULT_ZPOS)
|
if (win == DEFAULT_ZPOS)
|
||||||
win = ctx->default_win;
|
win = ctx->default_win;
|
||||||
|
|
||||||
if (win < 0 || win > WINDOWS_NR)
|
if (win < 0 || win >= WINDOWS_NR)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
win_data = &ctx->win_data[win];
|
win_data = &ctx->win_data[win];
|
||||||
|
@ -622,7 +622,7 @@ static void fimd_win_disable(struct device *dev, int zpos)
|
||||||
if (win == DEFAULT_ZPOS)
|
if (win == DEFAULT_ZPOS)
|
||||||
win = ctx->default_win;
|
win = ctx->default_win;
|
||||||
|
|
||||||
if (win < 0 || win > WINDOWS_NR)
|
if (win < 0 || win >= WINDOWS_NR)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
win_data = &ctx->win_data[win];
|
win_data = &ctx->win_data[win];
|
||||||
|
|
Loading…
Reference in New Issue