summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/msm
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-07-03 07:57:57 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-07-03 07:57:57 -0700
commit81d10d5081b8bf46d1d3c772b726a93ec8ef583f (patch)
treede2aa49c2975573a580314fb86d0b3b2fc5e8a39 /drivers/video/fbdev/msm
parent74b5a0f867adb63329a83dc9de961fba82b3cd54 (diff)
parent151c1e441a98ce96670ade0c31b0cb4ff5e62750 (diff)
Merge "fbdev: msm: Add check for ioctl calls"
Diffstat (limited to 'drivers/video/fbdev/msm')
-rw-r--r--drivers/video/fbdev/msm/mdss_fb.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/video/fbdev/msm/mdss_fb.c b/drivers/video/fbdev/msm/mdss_fb.c
index 31cba148ad28..42ea4b0b82b1 100644
--- a/drivers/video/fbdev/msm/mdss_fb.c
+++ b/drivers/video/fbdev/msm/mdss_fb.c
@@ -4921,6 +4921,15 @@ static int __ioctl_wait_idle(struct msm_fb_data_type *mfd, u32 cmd)
return ret;
}
+static bool check_not_supported_ioctl(u32 cmd)
+{
+ return((cmd == MSMFB_OVERLAY_SET) || (cmd == MSMFB_OVERLAY_UNSET) ||
+ (cmd == MSMFB_OVERLAY_GET) || (cmd == MSMFB_OVERLAY_PREPARE) ||
+ (cmd == MSMFB_DISPLAY_COMMIT) || (cmd == MSMFB_OVERLAY_PLAY) ||
+ (cmd == MSMFB_BUFFER_SYNC) || (cmd == MSMFB_OVERLAY_QUEUE) ||
+ (cmd == MSMFB_NOTIFY_UPDATE));
+}
+
/*
* mdss_fb_do_ioctl() - MDSS Framebuffer ioctl function
* @info: pointer to framebuffer info
@@ -4955,6 +4964,11 @@ int mdss_fb_do_ioctl(struct fb_info *info, unsigned int cmd,
if (!pdata || pdata->panel_info.dynamic_switch_pending)
return -EPERM;
+ if (check_not_supported_ioctl(cmd)) {
+ pr_err("Unsupported ioctl\n");
+ return -EINVAL;
+ }
+
atomic_inc(&mfd->ioctl_ref_cnt);
mdss_fb_power_setting_idle(mfd);