From: Ray Jui <ray.jui@broadcom.com>
To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Bjorn Helgaas <helgaas@kernel.org>,
linux-kernel@vger.kernel.org,
bcm-kernel-feedback-list@broadcom.com, linux-pci@vger.kernel.org,
Rafal Milecki <rafal@milecki.pl>,
stable@vger.kernel.org
Subject: Re: [PATCH] PCI: iproc: Fix NULL pointer dereference for BCMA
Date: Thu, 11 Jan 2018 12:37:28 -0800 [thread overview]
Message-ID: <576164e1-fffd-7ba0-5e35-9f0dd501df8e@broadcom.com> (raw)
In-Reply-To: <20180111171450.GA12148@red-moon>
Hi Lorenzo,
On 1/11/2018 9:15 AM, Lorenzo Pieralisi wrote:
> On Tue, Jan 09, 2018 at 11:45:40AM -0800, Ray Jui wrote:
>> With the inbound DMA mapping supported added, the iProc PCIe driver
>> parses DT property "dma-ranges" through call to
>> "of_pci_dma_range_parser_init". In the case of BCMA, this results in a
>> NULL pointer deference due to a missing of_node.
>>
>> Fix this by adding a guard in pcie-iproc-platform.c to only enable the
>> inbound DMA mapping logic when DT property "dma-ranges" is present
>>
>> fixes: dd9d4e7498de3 ("PCI: iproc: Add inbound DMA mapping support")
>
> s/fixes/Fixes >
Will fix.
>> Reported-by: Rafał Miłecki <rafal@milecki.pl>
>> Signed-off-by: Ray Jui <ray.jui@broadcom.com>
>> Tested-by: Rafał Miłecki <rafal@milecki.pl>
>> Cc: <stable@vger.kernel.org> # 4.10+
>> ---
>> drivers/pci/host/pcie-iproc-platform.c | 3 +++
>> drivers/pci/host/pcie-iproc.c | 8 +++++---
>> drivers/pci/host/pcie-iproc.h | 2 ++
>> 3 files changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/pci/host/pcie-iproc-platform.c b/drivers/pci/host/pcie-iproc-platform.c
>> index a5073a9..235c545 100644
>> --- a/drivers/pci/host/pcie-iproc-platform.c
>> +++ b/drivers/pci/host/pcie-iproc-platform.c
>> @@ -92,6 +92,9 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev)
>> pcie->need_ob_cfg = true;
>> }
>>
>> + if (of_property_read_bool(np, "dma-ranges"))
>> + pcie->need_ib_cfg = true;
>
> Nit:
> pci->need_ib_cfg = of_property_read_bool(np, "dma-ranges"));
>
> will do. Add a comment to it to explain why it is needed.
Will fix.
>
> Please update the patch, send a v2 and I will merge it.
Okay will send out v2 with comments from you addressed. Thanks!
>
> Thanks,
> Lorenzo
>
prev parent reply other threads:[~2018-01-11 20:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-09 19:45 [PATCH] PCI: iproc: Fix NULL pointer dereference for BCMA Ray Jui
2018-01-11 17:15 ` Lorenzo Pieralisi
2018-01-11 20:37 ` Ray Jui [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=576164e1-fffd-7ba0-5e35-9f0dd501df8e@broadcom.com \
--to=ray.jui@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=rafal@milecki.pl \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox