Commit fe6d29b0 authored by Liu Ying's avatar Liu Ying Committed by Luca Ceresoli
Browse files

drm/bridge: imx8qxp-pixel-combiner: Fix bailout for imx8qxp_pc_bridge_probe()



In case the channel0 is unavailable and bailing out from free_child is
needed when we fail to add a DRM bridge for the available channel1,
pointer pc->ch[0] in the bailout path would be NULL and it would be
dereferenced as pc->ch[0]->bridge.next_bridge.  Fix this by checking
pc->ch[0] before dereferencing it.

Fixes: ae754f04 ("drm/bridge: imx8qxp-pixel-combiner: get/put the next bridge")
Fixes: 99764593 ("drm/bridge: imx8qxp-pixel-combiner: convert to devm_drm_bridge_alloc() API")
Signed-off-by: default avatarLiu Ying <victor.liu@nxp.com>
Reviewed-by: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260123-imx8qxp-drm-bridge-fixes-v1-3-8bb85ada5866@nxp.com


Signed-off-by: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
parent 45c0a8a7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -348,7 +348,7 @@ static int imx8qxp_pc_bridge_probe(struct platform_device *pdev)
free_child:
	of_node_put(child);

	if (i == 1 && pc->ch[0]->bridge.next_bridge)
	if (i == 1 && pc->ch[0] && pc->ch[0]->bridge.next_bridge)
		drm_bridge_remove(&pc->ch[0]->bridge);

	pm_runtime_disable(dev);