[COMMON] fbdev: dpu: Added code to check if variable is NULL
authorhwangjae lee <hj-yo.lee@samsung.com>
Wed, 10 Oct 2018 11:43:55 +0000 (20:43 +0900)
committerhskang <hs1218.kang@samsung.com>
Thu, 11 Oct 2018 01:58:47 +0000 (10:58 +0900)
prevent 232754, 232758.

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

index 39061a32c5ce99bfea463cbd9115048dcf2a3c7a..9d01f0762574c6581c7ba0fa1e979c40457751cc 100644 (file)
@@ -510,10 +510,15 @@ 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)arg;
+       bool reset;
        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;