Skip to content
Snippets Groups Projects
Commit bcaf0b55 authored by Suman Mukherjee's avatar Suman Mukherjee Committed by Thierry Strudel
Browse files

msm: camera: ispif: Validate VFE num input during reset


Userspace supplies the actual number of used VFEs in session to ISPIF.
Validate the userspace input value and if found to be invalid, return
error.

Bug: 27804713
CRs-Fixed: 898074
Signed-off-by: default avatarVenu Yeshala <vyeshala@codeaurora.org>
Signed-off-by: default avatarSuman <Mukherjee&lt;sumam@codeaurora.org>
Change-Id: I3288ddb6404e817a705a92281b4c54666f372c56
parent 86ffac22
No related branches found
No related tags found
No related merge requests found
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2016, 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
......@@ -1133,9 +1133,15 @@ static irqreturn_t msm_io_ispif_irq(int irq_num, void *data)
static int msm_ispif_set_vfe_info(struct ispif_device *ispif,
struct msm_ispif_vfe_info *vfe_info)
{
memcpy(&ispif->vfe_info, vfe_info, sizeof(struct msm_ispif_vfe_info));
if (ispif->vfe_info.num_vfe > ispif->hw_num_isps)
if (!vfe_info || (vfe_info->num_vfe <= 0) ||
((uint32_t)(vfe_info->num_vfe) > ispif->hw_num_isps)) {
pr_err("Invalid VFE info: %p %d\n", vfe_info,
(vfe_info ? vfe_info->num_vfe:0));
return -EINVAL;
}
memcpy(&ispif->vfe_info, vfe_info, sizeof(struct msm_ispif_vfe_info));
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment