Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c4d89ce authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: Add check for ioctl calls"

parents c83deccf ef1114d3
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -4646,6 +4646,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
@@ -4680,6 +4689,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);