From: Seung-Woo Kim Date: Mon, 31 Aug 2015 03:07:55 +0000 (+0900) Subject: drm/exynos: fimc: fix wrong buf_id access for dma channel X-Git-Tag: submit/tizen/20160810.050017~166 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05a489936d19ef5e8f3dd4b7b7acedfdcee828a2;p=platform%2Fkernel%2Flinux-exynos.git 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 --- 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) {