Skip to content

Commit 0c25ab9

Browse files
Li Huafeigregkh
authored andcommitted
media: atomisp: Add check for rgby_data memory allocation failure
[ Upstream commit ed61c59 ] In ia_css_3a_statistics_allocate(), there is no check on the allocation result of the rgby_data memory. If rgby_data is not successfully allocated, it may trigger the assert(host_stats->rgby_data) assertion in ia_css_s3a_hmem_decode(). Adding a check to fix this potential issue. Fixes: a49d253 ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Li Huafei <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent e369246 commit 0c25ab9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/staging/media/atomisp/pci/sh_css_params.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4181,6 +4181,8 @@ ia_css_3a_statistics_allocate(const struct ia_css_3a_grid_info *grid)
41814181
goto err;
41824182
/* No weighted histogram, no structure, treat the histogram data as a byte dump in a byte array */
41834183
me->rgby_data = kvmalloc(sizeof_hmem(HMEM0_ID), GFP_KERNEL);
4184+
if (!me->rgby_data)
4185+
goto err;
41844186

41854187
IA_CSS_LEAVE("return=%p", me);
41864188
return me;

0 commit comments

Comments
 (0)