From: hwangjae lee Date: Thu, 11 Oct 2018 00:45:29 +0000 (+0900) Subject: [9610] fbdev: dpu: prevent error corrected X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6bd0b610ff68b64bf51a3a432a2e3d955d66ada8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [9610] fbdev: dpu: prevent error corrected CID : 244154, 244164 Change-Id: Ic1df7246bf346a1c45c95cdc8d185cd07ef80e54 Signed-off-by: hwangjae lee --- diff --git a/drivers/video/fbdev/exynos/dpu20/dpp_drv.c b/drivers/video/fbdev/exynos/dpu20/dpp_drv.c index 9d01f0762574..4a154cc011fe 100644 --- a/drivers/video/fbdev/exynos/dpu20/dpp_drv.c +++ b/drivers/video/fbdev/exynos/dpu20/dpp_drv.c @@ -510,15 +510,10 @@ err: static long dpp_subdev_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) { struct dpp_device *dpp = v4l2_get_subdevdata(sd); - bool reset; + bool reset = (bool)arg; int ret = 0; int *afbc_enabled; - if (arg == NULL) - return -1; - else - reset = (bool)arg; - switch (cmd) { case DPP_WIN_CONFIG: dpp->dpp_config = (struct dpp_config *)arg; @@ -542,6 +537,11 @@ static long dpp_subdev_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg break; case DPP_AFBC_ATTR_ENABLED: + if (!arg) { + dpp_err("failed to get afbc enabled info\n"); + ret = -EINVAL; + break; + } afbc_enabled = (int *)arg; ret = dpp_afbc_enabled(dpp, afbc_enabled); break; @@ -551,6 +551,11 @@ static long dpp_subdev_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg break; case DPP_GET_RESTRICTION: + if (!arg) { + dpp_err("failed to get dpp restriction\n"); + ret = -EINVAL; + break; + } memcpy((struct dpp_restriction *)arg, &dpp->restriction, sizeof(struct dpp_restriction)); break;