mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
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=27600832 Change-Id: I91944434e9a83d34af765c40bf8ad297a09ce2f5
This commit is contained in:
parent
72d3908cc1
commit
cbd741f1c3
1 changed files with 7 additions and 0 deletions
|
@ -920,6 +920,13 @@ static irqreturn_t msm_io_ispif_irq(int irq_num, void *data)
|
||||||
static int msm_ispif_set_vfe_info(struct ispif_device *ispif,
|
static int msm_ispif_set_vfe_info(struct ispif_device *ispif,
|
||||||
struct msm_ispif_vfe_info *vfe_info)
|
struct msm_ispif_vfe_info *vfe_info)
|
||||||
{
|
{
|
||||||
|
if (!vfe_info || (vfe_info->num_vfe <= 0) ||
|
||||||
|
((uint32_t)(vfe_info->num_vfe) > VFE_MAX)) {
|
||||||
|
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));
|
memcpy(&ispif->vfe_info, vfe_info, sizeof(struct msm_ispif_vfe_info));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue