summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2015-08-31 12:07:55 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:50:49 +0900
commitced9d08d506ed40b2ca17ba3a3a99a6a2a72f8ae (patch)
tree6191eacc6c981e4068bf9dfcb977901f66c8b386
parent53f45d84eec9b60d08e76138c1623a46b7817fbe (diff)
drm/exynos: fimc: fix wrong buf_id access for dma channel
For destination buffers, buf_id is valid only less than maximum dest buffer count. So this patch fixes wrong buf_id access to dma_channel. Change-Id: I4c73ab90a2fc8e57ecb82f277d3d53c2e91b910a Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimc.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
index 8a88c6840dfd..f63ea1a2626b 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
@@ -794,10 +794,7 @@ static int fimc_src_set_addr(struct device *dev,
DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
property->prop_id, buf_id, buf_type);
- if (buf_id > FIMC_MAX_SRC) {
- dev_info(ippdrv->dev, "invalid buf_id %d.\n", buf_id);
- return -ENOMEM;
- }
+ buf_id %= FIMC_MAX_SRC;
/* address register set */
switch (buf_type) {
@@ -1263,10 +1260,7 @@ static int fimc_dst_set_addr(struct device *dev,
DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
property->prop_id, buf_id, buf_type);
- if (buf_id > FIMC_MAX_DST) {
- dev_info(ippdrv->dev, "invalid buf_id %d.\n", buf_id);
- return -ENOMEM;
- }
+ buf_id %= FIMC_MAX_DST;
/* address register set */
switch (buf_type) {