Skip to content

Commit 6b80822

Browse files
JiangJiasHans Verkuil
authored andcommitted
media: coda: Add check for dcoda_iram_alloc
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent a8a0bc8 commit 6b80822

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

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

@@ -878,7 +878,7 @@ static void coda_setup_iram(struct coda_ctx *ctx)
878878

879879
iram_info->buf_dbk_y_use = coda_iram_alloc(iram_info, w128);
880880
iram_info->buf_dbk_c_use = coda_iram_alloc(iram_info, w128);
881-
if (!iram_info->buf_dbk_c_use)
881+
if (!iram_info->buf_dbk_y_use || !iram_info->buf_dbk_c_use)
882882
goto out;
883883
iram_info->axi_sram_use |= dbk_bits;
884884

0 commit comments

Comments
 (0)