From: Murali Karicheri <m-karicheri2@ti.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: <linux-pci@vger.kernel.org>
Subject: Re: [PATCH] PCI: keystone: Don't dereference possible NULL pointer
Date: Mon, 27 Apr 2015 12:12:17 -0400 [thread overview]
Message-ID: <553E5FE1.3030101@ti.com> (raw)
In-Reply-To: <20150409194540.18977.25638.stgit@bhelgaas-glaptop2.roam.corp.google.com>
On 04/09/2015 03:45 PM, Bjorn Helgaas wrote:
> Check for failure from platform_get_resource() (this check actually happens
> inside devm_ioremap_resource()) before dereferencing the pointer returned
> from platform_get_resource().
>
> Signed-off-by: Bjorn Helgaas<bhelgaas@google.com>
> ---
> drivers/pci/host/pci-keystone-dw.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/host/pci-keystone-dw.c b/drivers/pci/host/pci-keystone-dw.c
> index 66d8ea41b972..f34892e0edb4 100644
> --- a/drivers/pci/host/pci-keystone-dw.c
> +++ b/drivers/pci/host/pci-keystone-dw.c
> @@ -496,11 +496,12 @@ int __init ks_dw_pcie_host_init(struct keystone_pcie *ks_pcie,
>
> /* Index 1 is the application reg. space address */
> res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - ks_pcie->app = *res;
> ks_pcie->va_app_base = devm_ioremap_resource(pp->dev, res);
> if (IS_ERR(ks_pcie->va_app_base))
> return PTR_ERR(ks_pcie->va_app_base);
>
> + ks_pcie->app = *res;
> +
> /* Create legacy IRQ domain */
> ks_pcie->legacy_irq_domain =
> irq_domain_add_linear(ks_pcie->legacy_intc_np,
>
Bjorn,
Thanks for fixing this.
Acked-By: Murali Karicheri <m-karicheri2@ti.com>
prev parent reply other threads:[~2015-04-27 16:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-09 19:45 [PATCH] PCI: keystone: Don't dereference possible NULL pointer Bjorn Helgaas
2015-04-27 16:12 ` Murali Karicheri [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=553E5FE1.3030101@ti.com \
--to=m-karicheri2@ti.com \
--cc=bhelgaas@google.com \
--cc=linux-pci@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.