mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
drm/mediatek: Fix pdev reference leak in mtk_drm_bind()
When the device is not the mmsys master, mtk_drm_bind() returns early
after taking a reference on the disp-mutex device via
of_find_device_by_node(), without ever dropping it: mtk_drm_unbind()
only puts mutex_dev for the master. Drop the reference before returning
from the non-master path.
Fixes: 1ef7ed4835 ("drm/mediatek: Modify mediatek-drm for mt8195 multi mmsys support")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20260916174058.2088709-1-vulab@iscas.ac.cn/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
This commit is contained in:
parent
3e292c56bf
commit
3753e34b73
|
|
@ -638,8 +638,10 @@ static int mtk_drm_bind(struct device *dev)
|
|||
private->mtk_drm_bound = true;
|
||||
private->dev = dev;
|
||||
|
||||
if (!mtk_drm_get_all_drm_priv(dev))
|
||||
if (!mtk_drm_get_all_drm_priv(dev)) {
|
||||
put_device(private->mutex_dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm = drm_dev_alloc(&mtk_drm_driver, dev);
|
||||
if (IS_ERR(drm)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user