Skip to content

Commit b998721

Browse files
JiangJiasgregkh
authored andcommitted
media: coda: Add check for dcoda_iram_alloc
[ Upstream commit 6b80822 ] As the coda_iram_alloc may return NULL pointer, it should be better to check the return value in order to avoid NULL poineter dereference, same as the others. Fixes: b313bcc ("[media] coda: simplify IRAM setup") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent fbf081e commit b998721

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/media/platform/coda/coda-bit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ static void coda_setup_iram(struct coda_ctx *ctx)
852852
/* Only H.264BP and H.263P3 are considered */
853853
iram_info->buf_dbk_y_use = coda_iram_alloc(iram_info, w64);
854854
iram_info->buf_dbk_c_use = coda_iram_alloc(iram_info, w64);
855-
if (!iram_info->buf_dbk_c_use)
855+
if (!iram_info->buf_dbk_y_use || !iram_info->buf_dbk_c_use)
856856
goto out;
857857
iram_info->axi_sram_use |= dbk_bits;
858858

@@ -876,7 +876,7 @@ static void coda_setup_iram(struct coda_ctx *ctx)
876876

877877
iram_info->buf_dbk_y_use = coda_iram_alloc(iram_info, w128);
878878
iram_info->buf_dbk_c_use = coda_iram_alloc(iram_info, w128);
879-
if (!iram_info->buf_dbk_c_use)
879+
if (!iram_info->buf_dbk_y_use || !iram_info->buf_dbk_c_use)
880880
goto out;
881881
iram_info->axi_sram_use |= dbk_bits;
882882

0 commit comments

Comments
 (0)