linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Proposed prom parse fix + moving.
@ 2009-04-17  6:08 Michal Simek
  2009-04-17  6:44 ` Grant Likely
  2009-04-17  7:43 ` Benjamin Herrenschmidt
  0 siblings, 2 replies; 8+ messages in thread
From: Michal Simek @ 2009-04-17  6:08 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: ilpo.jarvinen, Arnd Bergmann

Hi All,

I have got email from Ilpo about prom_parse file.
I take this file from powerpc. Who did write prom_parse file and take care about?

BTW: What about to move prom_parse file to any generic location as we discussed in past?
Any volunteer?

Thanks,
Michal


-------- Original Message --------
Subject: [RFC!] [PATCH] microblaze: fix bug in error handling
Date: Thu, 16 Apr 2009 23:05:53 +0300 (EEST)
From: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
To: monstr@monstr.eu
CC: microblaze-uclinux@itee.uq.edu.au

While some version of the patches were on the lkml I read
some part of the code briefly through but my feedback got
stuck into postponed emails, so here's one correctness
related issue I might have found (the rest were just
cosmetic things).

I'm not sure if the latter return needs the of_node_put or not
but it seems more likely than not.

Not even compile tested.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 arch/microblaze/kernel/prom_parse.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/microblaze/kernel/prom_parse.c b/arch/microblaze/kernel/prom_parse.c
index ae0352e..d1174bc 100644
--- a/arch/microblaze/kernel/prom_parse.c
+++ b/arch/microblaze/kernel/prom_parse.c
@@ -927,20 +927,23 @@ int of_irq_map_one(struct device_node *device,
 	/* Get size of interrupt specifier */
 	tmp = of_get_property(p, "#interrupt-cells", NULL);
 	if (tmp == NULL) {
-		of_node_put(p);
-		return -EINVAL;
+		res = -EINVAL;
+		goto out;
 	}
 	intsize = *tmp;

 	pr_debug(" intsize=%d intlen=%d\n", intsize, intlen);

 	/* Check index */
-	if ((index + 1) * intsize > intlen)
-		return -EINVAL;
+	if ((index + 1) * intsize > intlen) {
+		res = -EINVAL;
+		goto out;
+	}

 	/* Get new specifier and map it */
 	res = of_irq_map_raw(p, intspec + index * intsize, intsize,
 				addr, out_irq);
+out:
 	of_node_put(p);
 	return res;
 }
-- 
1.5.6.5


-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-04-20 21:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-17  6:08 Proposed prom parse fix + moving Michal Simek
2009-04-17  6:44 ` Grant Likely
2009-04-17 12:59   ` Michal Simek
2009-04-17 13:02     ` Ilpo Järvinen
2009-04-17 22:07       ` Ilpo Järvinen
2009-04-18  5:35         ` Grant Likely
2009-04-20 21:15           ` Grant Likely
2009-04-17  7:43 ` Benjamin Herrenschmidt

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).