linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jgunthorpe@obsidianresearch.com (Jason Gunthorpe)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] bus: mvebu-mbus: Fix optional pcie-mem/io-aperture properties
Date: Tue, 17 Sep 2013 12:38:53 -0600	[thread overview]
Message-ID: <20130917183853.GC21230@obsidianresearch.com> (raw)

If the property was not specified then then the returned resource
had a resource_size(..) == 1, rather than 0. The PCI-E driver checks
for 0 so it blindly continues on with a corrupted resource.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 drivers/bus/mvebu-mbus.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index 19ab6ff..7a66203 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -866,6 +866,8 @@ static void __init mvebu_mbus_get_pcie_resources(struct device_node *np,
 	 */
 	memset(mem, 0, sizeof(struct resource));
 	memset(io, 0, sizeof(struct resource));
+	mem->end--;
+	io->end--;
 
 	ret = of_property_read_u32_array(np, "pcie-mem-aperture", reg, ARRAY_SIZE(reg));
 	if (!ret) {
-- 
1.8.1.2

             reply	other threads:[~2013-09-17 18:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-17 18:38 Jason Gunthorpe [this message]
2013-09-17 19:05 ` [PATCH] bus: mvebu-mbus: Fix optional pcie-mem/io-aperture properties Thomas Petazzoni
2013-09-17 19:13   ` Jason Gunthorpe
2013-09-17 19:22     ` Thomas Petazzoni

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=20130917183853.GC21230@obsidianresearch.com \
    --to=jgunthorpe@obsidianresearch.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).