Merge "msm: camera: cpp: Add validation for v4l2 ioctl arguments"

This commit is contained in:
Linux Build Service Account 2016-12-30 06:27:32 -08:00 committed by Gerrit - the friendly Code Review server
commit 3a0a78d5f0

View file

@ -2913,15 +2913,14 @@ static int msm_cpp_validate_input(unsigned int cmd, void *arg,
break;
default: {
if (ioctl_ptr == NULL) {
pr_err("Wrong ioctl_ptr %pK for cmd %u\n",
ioctl_ptr, cmd);
pr_err("Wrong ioctl_ptr for cmd %u\n", cmd);
return -EINVAL;
}
*ioctl_ptr = arg;
if ((*ioctl_ptr == NULL) ||
((*ioctl_ptr)->ioctl_ptr == NULL)) {
pr_err("Wrong arg %pK for cmd %u\n", arg, cmd);
pr_err("Error invalid ioctl argument cmd %u", cmd);
return -EINVAL;
}
break;