Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1506085 > unrolled thread

Re: [PATCH] PCI: layerscape: Fix kernel panic on accessing NULL pointer

Started byBjorn Helgaas <helgaas@kernel.org>
First post2016-10-21 17:40 +0200
Last post2016-10-21 18:20 +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.


Contents

  Re: [PATCH] PCI: layerscape: Fix kernel panic on accessing NULL  pointer Bjorn Helgaas <helgaas@kernel.org> - 2016-10-21 17:40 +0200
    RE: [PATCH] PCI: layerscape: Fix kernel panic on accessing NULL  pointer Leo Li <leoyang.li@nxp.com> - 2016-10-21 18:20 +0200

#1506085 — Re: [PATCH] PCI: layerscape: Fix kernel panic on accessing NULL pointer

FromBjorn Helgaas <helgaas@kernel.org>
Date2016-10-21 17:40 +0200
SubjectRe: [PATCH] PCI: layerscape: Fix kernel panic on accessing NULL pointer
Message-ID<suK5k-7xe-11@gated-at.bofh.it>
On Mon, Oct 17, 2016 at 04:44:06PM -0500, Li Yang wrote:
> Commit fefe6733e added reference to the pcie->drvdata before it is
> initialized which causes a kernel panic.  Fix the problem by
> initializing the pcie->drvdata earlier before it is used.
> 
> Reported-by: Stuart Yoder <stuart.yoder@nxp.com>
> Signed-off-by: Li Yang <leoyang.li@nxp.com>

I applied Marc Zyngier's identical patch to for-linus for v4.9.  I don't
know which was posted first, but I saw Marc's first.  Sorry I didn't at
least credit you when I applied it.

> ---
>  drivers/pci/host/pci-layerscape.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/host/pci-layerscape.c b/drivers/pci/host/pci-layerscape.c
> index 2cb7315..958187f 100644
> --- a/drivers/pci/host/pci-layerscape.c
> +++ b/drivers/pci/host/pci-layerscape.c
> @@ -245,6 +245,7 @@ static int __init ls_pcie_probe(struct platform_device *pdev)
>  	if (!pcie)
>  		return -ENOMEM;
>  
> +	pcie->drvdata = match->data;
>  	pp = &pcie->pp;
>  	pp->dev = dev;
>  	pp->ops = pcie->drvdata->ops;
> @@ -256,7 +257,6 @@ static int __init ls_pcie_probe(struct platform_device *pdev)
>  		return PTR_ERR(pcie->pp.dbi_base);
>  	}
>  
> -	pcie->drvdata = match->data;
>  	pcie->lut = pcie->pp.dbi_base + pcie->drvdata->lut_offset;
>  
>  	if (!ls_pcie_is_bridge(pcie))
> -- 
> 1.9.0
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

[toc] | [next] | [standalone]


#1506122

FromLeo Li <leoyang.li@nxp.com>
Date2016-10-21 18:20 +0200
Message-ID<suKI2-84M-11@gated-at.bofh.it>
In reply to#1506085

> -----Original Message-----
> From: Bjorn Helgaas [mailto:helgaas@kernel.org]
> Sent: Friday, October 21, 2016 10:37 AM
> To: Leo Li <leoyang.li@nxp.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>; Minghuan Lian
> <minghuan.Lian@freescale.com>; Mingkai Hu <mingkai.hu@freescale.com>;
> Roy Zang <tie-fei.zang@freescale.com>; linux-pci@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; Stuart Yoder
> <stuart.yoder@nxp.com>
> Subject: Re: [PATCH] PCI: layerscape: Fix kernel panic on accessing NULL pointer
> 
> On Mon, Oct 17, 2016 at 04:44:06PM -0500, Li Yang wrote:
> > Commit fefe6733e added reference to the pcie->drvdata before it is
> > initialized which causes a kernel panic.  Fix the problem by
> > initializing the pcie->drvdata earlier before it is used.
> >
> > Reported-by: Stuart Yoder <stuart.yoder@nxp.com>
> > Signed-off-by: Li Yang <leoyang.li@nxp.com>
> 
> I applied Marc Zyngier's identical patch to for-linus for v4.9.  I don't know which
> was posted first, but I saw Marc's first.  Sorry I didn't at least credit you when I
> applied it.

It's ok.  Seems Marc sent the patch earlier and I didn't notice his patch.  There is no difference as long as the problem is addressed.  :)

Regards,
Leo

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web