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

Commit 9fbd9f9f authored by Hariram Purushothaman's avatar Hariram Purushothaman
Browse files

msm: camera: Check length of cmd_len to zero in isp driver



Validate the length of cmd_len not to be zero
in ISP driver which is from a userspace argument.

Change-Id: I3238cd7426c5315e49c5ac7b453156e0b3d48ec0
CRs-Fixed: 548804
Signed-off-by: default avatarHariram Purushothaman <hpurus@codeaurora.org>
parent c936945a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -619,6 +619,12 @@ int msm_isp_proc_cmd(struct vfe_device *vfe_dev, void *arg)
		goto reg_cfg_failed;
	}

	if (!proc_cmd->cmd_len) {
		pr_err("%s: Passed cmd_len as 0\n", __func__);
		rc = -EINVAL;
		goto cfg_data_failed;
	}

	cfg_data = kzalloc(proc_cmd->cmd_len, GFP_KERNEL);
	if (!cfg_data) {
		pr_err("%s: cfg_data alloc failed\n", __func__);