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

Commit 2e31f9f3 authored by VijayaKumar T M's avatar VijayaKumar T M
Browse files

msm: isp: Avoid unaligned register access



Unaligned register access will reslut in device
crash. Avoid them by checking the register address
before accessing them.

Same as (Ib58efa2a68115ec9929b9270c123c904737196ee)

CRs-Fixed: 1001412
Change-Id: Iaf9201421f4e9abd03997b4ac6f08fdbe7c69515
Signed-off-by: default avatarAbhishek Kondaveeti <akondave@codeaurora.org>
Signed-off-by: default avatarVijayaKumar T M <vtmuni@codeaurora.org>
parent c97f5cfd
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -918,7 +918,8 @@ static int msm_isp_send_hw_cmd(struct vfe_device *vfe_dev,
			(UINT_MAX - reg_cfg_cmd->u.rw_info.len)) ||
			((reg_cfg_cmd->u.rw_info.reg_offset +
			reg_cfg_cmd->u.rw_info.len) >
			resource_size(vfe_dev->vfe_mem))) {
			resource_size(vfe_dev->vfe_mem)) ||
			(reg_cfg_cmd->u.rw_info.reg_offset & 0x3)) {
			pr_err("%s:%d reg_offset %d len %d res %d\n",
				__func__, __LINE__,
				reg_cfg_cmd->u.rw_info.reg_offset,
@@ -1018,7 +1019,8 @@ static int msm_isp_send_hw_cmd(struct vfe_device *vfe_dev,
			reg_cfg_cmd->u.mask_info.reg_offset) ||
			(resource_size(vfe_dev->vfe_mem) <
			reg_cfg_cmd->u.mask_info.reg_offset +
			sizeof(temp))) {
			sizeof(temp)) ||
			(reg_cfg_cmd->u.mask_info.reg_offset & 0x3)) {
			pr_err("%s: VFE_CFG_MASK: Invalid length\n", __func__);
			return -EINVAL;
		}