[PATCH] media: mediatek: vcodec: Fix a reference leak in mtk_vcodec_fw_vpu_init()

AngeloGioacchino Del Regno angelogioacchino.delregno at collabora.com
Wed Sep 17 04:55:51 PDT 2025


Il 15/09/25 14:09, Haoxiang Li ha scritto:
> vpu_get_plat_device() increases the reference count of the returned
> platform device. However, when devm_kzalloc() fails, the reference
> is not released, causing a reference leak.
> 
> Fix this by calling put_device() on fw_pdev->dev before returning
> on the error path.
> 
> Fixes: e25a89f743b1 ("media: mtk-vcodec: potential dereference of null pointer")
> Cc: stable at vger.kernel.org
> Signed-off-by: Haoxiang Li <haoxiang_li2024 at 163.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>





More information about the Linux-mediatek mailing list