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

Commit 3e657b1e authored by Terence Ho's avatar Terence Ho
Browse files

msm: ais: cpp fix to check zero length ioctl



Port of ioctl validation for zero length ioctl
from camera_v2.

Change-Id: I635522f331d1e18641196ee3101c64ccc285636a
CRs-fixed: 2025367
Signed-off-by: default avatarTerence Ho <terenceh@codeaurora.org>
parent e539a094
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -2868,6 +2868,8 @@ static int msm_cpp_validate_input(unsigned int cmd, void *arg,
	case MSM_SD_SHUTDOWN:
	case MSM_SD_NOTIFY_FREEZE:
	case MSM_SD_UNNOTIFY_FREEZE:
	case VIDIOC_MSM_CPP_IOMMU_ATTACH:
	case VIDIOC_MSM_CPP_IOMMU_DETACH:
		break;
	default: {
		if (ioctl_ptr == NULL) {
@@ -2876,8 +2878,9 @@ static int msm_cpp_validate_input(unsigned int cmd, void *arg,
		}

		*ioctl_ptr = arg;
		if ((*ioctl_ptr == NULL) ||
			(*ioctl_ptr)->ioctl_ptr == NULL) {
		if (((*ioctl_ptr) == NULL) ||
			((*ioctl_ptr)->ioctl_ptr == NULL) ||
			((*ioctl_ptr)->len == 0)) {
			pr_err("Error invalid ioctl argument cmd %u", cmd);
			return -EINVAL;
		}