media: platform: mtk-mdp3: fix NULL deref on failed SCP lookup
Subsystems (3)
PATCH 1/1 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 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver")
Cc [email protected] # 6.1
Cc Moudy Ho <[email protected]>
Signed-off-by Johan Hovold <[email protected]>
---
This one applies on top of Guangshuo's fix:
https://lore.kernel.org/r/[email protected]
Johan
drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c +5 -0
@@ -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);
Signature · 1 line
2.54.0