[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aMjdBSP1bvwvTRiO@google.com>
Date: Tue, 16 Sep 2025 03:44:05 +0000
From: Tzung-Bi Shih <tzungbi@...nel.org>
To: Haoxiang Li <haoxiang_li2024@....com>
Cc: tiffany.lin@...iatek.com, andrew-ct.chen@...iatek.com,
yunfei.dong@...iatek.com, mchehab@...nel.org,
matthias.bgg@...il.com, angelogioacchino.delregno@...labora.com,
hverkuil@...nel.org, jiasheng@...as.ac.cn,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, stable@...r.kernel.org
Subject: Re: [PATCH] media: mediatek: vcodec: Fix a reference leak in
mtk_vcodec_fw_vpu_init()
On Mon, Sep 15, 2025 at 08:09:38PM +0800, Haoxiang Li wrote:
> 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@...r.kernel.org
> Signed-off-by: Haoxiang Li <haoxiang_li2024@....com>
The reference, taking via of_find_device_by_node(), needs to be dropped after
use. mtk_vcodec_vpu_release() does but the error handling path doesn't.
Reviewed-by: Tzung-Bi Shih <tzungbi@...nel.org>
Powered by blists - more mailing lists