[9610] fbdev: dpu: prevent error corrected
authorhwangjae lee <hj-yo.lee@samsung.com>
Thu, 11 Oct 2018 00:45:29 +0000 (09:45 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:05 +0000 (20:23 +0300)
CID : 244154, 244164

Change-Id: Ic1df7246bf346a1c45c95cdc8d185cd07ef80e54
Signed-off-by: hwangjae lee <hj-yo.lee@samsung.com>
drivers/video/fbdev/exynos/dpu20/dpp_drv.c

index 9d01f0762574c6581c7ba0fa1e979c40457751cc..4a154cc011fe55cf80ccf1548a08a47a70f86fc5 100644 (file)
@@ -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;