mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
media: platform: mtk-mdp3: fix NULL deref on failed SCP lookup
Add the missing sanity check after looking up the SCP to avoid
dereferencing a NULL-pointer in case its driver has not yet been bound.
Fixes: 61890ccaef ("media: platform: mtk-mdp3: add MediaTek MDP3 driver")
Cc: stable@vger.kernel.org # 6.1
Cc: Moudy Ho <moudy.ho@mediatek.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
55793e4665
commit
90368323fb
|
|
@ -296,6 +296,11 @@ static int mdp_probe(struct platform_device *pdev)
|
|||
mdp->scp = platform_get_drvdata(mm_pdev);
|
||||
}
|
||||
|
||||
if (!mdp->scp) {
|
||||
ret = -EPROBE_DEFER;
|
||||
goto err_destroy_clock_wq;
|
||||
}
|
||||
|
||||
mdp->rproc_handle = scp_get_rproc(mdp->scp);
|
||||
dev_dbg(&pdev->dev, "MDP rproc_handle: %p", mdp->rproc_handle);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user