[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#404216: Patch tested against linux-image-2.6.18-3-sparc64 2.6.18-7



Hi,

The attached patch has been tested with the sources for 2.6.18-7 and
fixes the problem for me. This patch has been passed on upstream and
Jurij is aware of it.

Richard

-- 
Richard Mortimer <richm@oldelvet.org.uk>
>From b5530bfb19f6dc678c0be88f2071ba79e92b9d3a Mon Sep 17 00:00:00 2001
From: Richard Mortimer <richm@oldelvet.org.uk>
Date: Sat, 23 Dec 2006 22:57:10 +0000
Subject: [PATCH] sparc64: isa.c should cope with OBP nodes with no "reg" property

The todm5819 Openboot device node on Netra X1 does not have a "reg"
property. In this case of_get_property returns NULL resulting in an
Oops. Avoid this by returning from isa_dev_get_resource() without
attempting to request_resource().

Signed-off-by: Richard Mortimer <richm@oldelvet.org.uk>
---
 arch/sparc64/kernel/isa.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/sparc64/kernel/isa.c b/arch/sparc64/kernel/isa.c
index ad1c4f5..cb556f0 100644
--- a/arch/sparc64/kernel/isa.c
+++ b/arch/sparc64/kernel/isa.c
@@ -31,6 +31,10 @@ isa_dev_get_resource(struct sparc_isa_device *isa_dev)
 
 	pregs = of_get_property(isa_dev->prom_node, "reg", &prop_len);
 
+	if (!pregs) {
+		return NULL;
+	}
+
 	/* Only the first one is interesting. */
 	len = pregs[0].reg_size;
 	base = (((unsigned long)pregs[0].which_io << 32) |
-- 
1.4.4.2


Reply to: