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

Commit 020d79c4 authored by Trishansh Bhardwaj's avatar Trishansh Bhardwaj Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: Add error check for cmd in IOCTL.



Return EINVAL if cmd is not v4l2 PRIVATE_IOCTL_CMD.

Change-Id: Iaffa0f2062ea9832dfbaf58a5477185721ff0046
Signed-off-by: default avatarTrishansh Bhardwaj <tbhardwa@codeaurora.org>
parent 726d5dfb
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -485,6 +485,9 @@ static long camera_v4l2_vidioc_private_ioctl(struct file *filep, void *fh,
	if (WARN_ON(!k_ioctl || !pvdev))
		return -EIO;

	if (cmd != VIDIOC_MSM_CAMERA_PRIVATE_IOCTL_CMD)
		return -EINVAL;

	switch (k_ioctl->id) {
	case MSM_CAMERA_PRIV_IOCTL_ID_RETURN_BUF: {
		struct msm_camera_return_buf ptr, *tmp = NULL;