Skip to content

Commit eeb62bb

Browse files
Fullway Wanggregkh
authored andcommitted
media: mtk-vcodec: potential null pointer deference in SCP
commit 53dbe08504442dc7ba4865c09b3bbf5fe849681b upstream. The return value of devm_kzalloc() needs to be checked to avoid NULL pointer deference. This is similar to CVE-2022-3113. Link: https://lore.kernel.org/linux-media/PH7PR20MB5925094DAE3FD750C7E39E01BF712@PH7PR20MB5925.namprd20.prod.outlook.com Signed-off-by: Fullway Wang <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Jianqi Ren <[email protected]> Signed-off-by: He Zhe <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 020ecb7 commit eeb62bb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_scp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ struct mtk_vcodec_fw *mtk_vcodec_fw_scp_init(struct mtk_vcodec_dev *dev)
6565
}
6666

6767
fw = devm_kzalloc(&dev->plat_dev->dev, sizeof(*fw), GFP_KERNEL);
68+
if (!fw)
69+
return ERR_PTR(-ENOMEM);
6870
fw->type = SCP;
6971
fw->ops = &mtk_vcodec_rproc_msg;
7072
fw->scp = scp;

0 commit comments

Comments
 (0)