Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1510946 > unrolled thread
| Started by | CK Hu <ck.hu@mediatek.com> |
|---|---|
| First post | 2016-10-28 10:40 +0200 |
| Last post | 2016-10-28 12:40 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] drm/mediatek: fix null pointer dereference CK Hu <ck.hu@mediatek.com> - 2016-10-28 10:40 +0200
Re: [PATCH] drm/mediatek: fix null pointer dereference Matthias Brugger <matthias.bgg@gmail.com> - 2016-10-28 12:40 +0200
| From | CK Hu <ck.hu@mediatek.com> |
|---|---|
| Date | 2016-10-28 10:40 +0200 |
| Subject | Re: [PATCH] drm/mediatek: fix null pointer dereference |
| Message-ID | <sxaRI-5SO-31@gated-at.bofh.it> |
Hi, Matthias:
Even though OVL HW would not be enabled before component_add() in
current design, your patch would be safe for any situation.
Acked-by CK Hu <ck.hu@mediatek.com>
Regards,
CK
On Wed, 2016-10-26 at 16:09 +0200, Matthias Brugger wrote:
> 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: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC
> MT8173.")
> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
> ---
> drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> index 019b7ca..1e78159 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> @@ -250,13 +250,6 @@ static int mtk_disp_ovl_probe(struct platform_device *pdev)
> if (irq < 0)
> 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);
> if (comp_id < 0) {
> dev_err(dev, "Failed to identify by alias: %d\n", comp_id);
> @@ -272,6 +265,13 @@ static int mtk_disp_ovl_probe(struct platform_device *pdev)
>
> 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);
> if (ret)
> dev_err(dev, "Failed to add component: %d\n", ret);
[toc] | [next] | [standalone]
| From | Matthias Brugger <matthias.bgg@gmail.com> |
|---|---|
| Date | 2016-10-28 12:40 +0200 |
| Message-ID | <sxcJQ-77Y-25@gated-at.bofh.it> |
| In reply to | #1510946 |
On 10/28/2016 10:34 AM, CK Hu wrote: > Hi, Matthias: > > Even though OVL HW would not be enabled before component_add() in > current design, your patch would be safe for any situation. Maybe the FW I use left an interrupt pending before loading the kernel and this leads to the case where we enter the handler before all data structures are set up. > > Acked-by CK Hu <ck.hu@mediatek.com> Thanks! Matthias
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web