diff options
author | Fullway Wang <fullwaywang@outlook.com> | 2024-01-18 03:35:06 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2024-05-03 08:06:51 +0200 |
commit | 53dbe08504442dc7ba4865c09b3bbf5fe849681b (patch) | |
tree | d8b39076b9b209aa2f2dd43920635c69a14a9e38 /drivers/media | |
parent | media: mxl5xx: Move xpt structures off stack (diff) | |
download | linux-53dbe08504442dc7ba4865c09b3bbf5fe849681b.tar.xz linux-53dbe08504442dc7ba4865c09b3bbf5fe849681b.zip |
media: mtk-vcodec: potential null pointer deference in SCP
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 <fullwaywang@outlook.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_scp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_scp.c b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_scp.c index 6bbe55de6ce9..ff23b225db70 100644 --- a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_scp.c +++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_scp.c @@ -79,6 +79,8 @@ struct mtk_vcodec_fw *mtk_vcodec_fw_scp_init(void *priv, enum mtk_vcodec_fw_use } fw = devm_kzalloc(&plat_dev->dev, sizeof(*fw), GFP_KERNEL); + if (!fw) + return ERR_PTR(-ENOMEM); fw->type = SCP; fw->ops = &mtk_vcodec_rproc_msg; fw->scp = scp; |