Commit ab34b429 authored by Matthias Brugger's avatar Matthias Brugger Committed by Greg Kroah-Hartman

drm/mediatek: fix null pointer dereference

commit 5ad45307 upstream.

The probe function requests the interrupt before initializing
the ddp component. Which leads to a null pointer dereference at boot.
Fix this by requesting the interrput after all components got
initialized properly.

Fixes: 119f5173 ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.")
Signed-off-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Change-Id: I57193a7ab554dfb37c35a455900689333adf511c
parent 43b5bb26
...@@ -249,13 +249,6 @@ static int mtk_disp_ovl_probe(struct platform_device *pdev) ...@@ -249,13 +249,6 @@ static int mtk_disp_ovl_probe(struct platform_device *pdev)
if (irq < 0) if (irq < 0)
return irq; return irq;
ret = devm_request_irq(dev, irq, mtk_disp_ovl_irq_handler,
IRQF_TRIGGER_NONE, dev_name(dev), priv);
if (ret < 0) {
dev_err(dev, "Failed to request irq %d: %d\n", irq, ret);
return ret;
}
comp_id = mtk_ddp_comp_get_id(dev->of_node, MTK_DISP_OVL); comp_id = mtk_ddp_comp_get_id(dev->of_node, MTK_DISP_OVL);
if (comp_id < 0) { if (comp_id < 0) {
dev_err(dev, "Failed to identify by alias: %d\n", comp_id); dev_err(dev, "Failed to identify by alias: %d\n", comp_id);
...@@ -271,6 +264,13 @@ static int mtk_disp_ovl_probe(struct platform_device *pdev) ...@@ -271,6 +264,13 @@ static int mtk_disp_ovl_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, priv); platform_set_drvdata(pdev, priv);
ret = devm_request_irq(dev, irq, mtk_disp_ovl_irq_handler,
IRQF_TRIGGER_NONE, dev_name(dev), priv);
if (ret < 0) {
dev_err(dev, "Failed to request irq %d: %d\n", irq, ret);
return ret;
}
ret = component_add(dev, &mtk_disp_ovl_component_ops); ret = component_add(dev, &mtk_disp_ovl_component_ops);
if (ret) if (ret)
dev_err(dev, "Failed to add component: %d\n", ret); dev_err(dev, "Failed to add component: %d\n", ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment