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

Commit 5b831a19 authored by Kamen Kirov's avatar Kamen Kirov Committed by Gerrit - the friendly Code Review server
Browse files

camera_v2: jpeg_10: Fix return value of MSM_JPEG_IOCTL_HW_CMD



The ioctl MSM_JPEG_IOCTL_HW_CMD was returning -1,
when using MSM_JPEG_HW_CMD_TYPE_WRITE due to incorrect input
validation logic.

Signed-off-by: default avatarKamen Kirov <kkirov@codeaurora.org>
Change-Id: Ib47973fe6e2c398ef11e6ec3179388a7823e0b3f
parent bfd1c27c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2014, 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
@@ -328,7 +328,7 @@ void msm_jpeg_hw_delay(struct msm_jpeg_hw_cmd *hw_cmd_p, int m_us)
int msm_jpeg_hw_exec_cmds(struct msm_jpeg_hw_cmd *hw_cmd_p, uint32_t m_cmds,
	uint32_t max_size, void *base)
{
	int is_copy_to_user = -1;
	int is_copy_to_user = 0;
	uint32_t data;

	while (m_cmds--) {
+3 −0
Original line number Diff line number Diff line
@@ -722,6 +722,9 @@ int msm_jpeg_ioctl_hw_cmds(struct msm_jpeg_device *pgmn_dev,
			kfree(hw_cmds_p);
			return -EFAULT;
		}
	} else {
		kfree(hw_cmds_p);
		return is_copy_to_user;
	}
	kfree(hw_cmds_p);
	return 0;