All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6/6 V3] sparc: Fix sbus_alloc_coherent error handling.
@ 2011-01-18 14:10 Kristoffer Glembo
  2011-01-18 19:43 ` Sam Ravnborg
  2011-01-22  0:52 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Kristoffer Glembo @ 2011-01-18 14:10 UTC (permalink / raw)
  To: sparclinux

Order of kfree and free_pages were swapped in the error handling.

Signed-off-by: Kristoffer Glembo <kristoffer@gaisler.com>
---
 arch/sparc/kernel/ioport.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index bd4fb10..c6ce9a6 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -302,9 +302,9 @@ static void *sbus_alloc_coherent(struct device *dev, size_t len,
 err_noiommu:
 	release_resource(res);
 err_nova:
-	free_pages(va, order);
-err_nomem:
 	kfree(res);
+err_nomem:
+	free_pages(va, order);
 err_nopages:
 	return NULL;
 }
-- 
1.6.4.1


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

* Re: [PATCH 6/6 V3] sparc: Fix sbus_alloc_coherent error handling.
  2011-01-18 14:10 [PATCH 6/6 V3] sparc: Fix sbus_alloc_coherent error handling Kristoffer Glembo
@ 2011-01-18 19:43 ` Sam Ravnborg
  2011-01-22  0:52 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Sam Ravnborg @ 2011-01-18 19:43 UTC (permalink / raw)
  To: sparclinux

On Tue, Jan 18, 2011 at 03:10:29PM +0100, Kristoffer Glembo wrote:
> Order of kfree and free_pages were swapped in the error handling.
Well spotted!

Acked-by: Sam Ravnborg <sam@ravnborg.org>

	Sam

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

* Re: [PATCH 6/6 V3] sparc: Fix sbus_alloc_coherent error handling.
  2011-01-18 14:10 [PATCH 6/6 V3] sparc: Fix sbus_alloc_coherent error handling Kristoffer Glembo
  2011-01-18 19:43 ` Sam Ravnborg
@ 2011-01-22  0:52 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2011-01-22  0:52 UTC (permalink / raw)
  To: sparclinux

From: Sam Ravnborg <sam@ravnborg.org>
Date: Tue, 18 Jan 2011 20:43:17 +0100

> On Tue, Jan 18, 2011 at 03:10:29PM +0100, Kristoffer Glembo wrote:
>> Order of kfree and free_pages were swapped in the error handling.
> Well spotted!
> 
> Acked-by: Sam Ravnborg <sam@ravnborg.org>

Applied.

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

end of thread, other threads:[~2011-01-22  0:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-18 14:10 [PATCH 6/6 V3] sparc: Fix sbus_alloc_coherent error handling Kristoffer Glembo
2011-01-18 19:43 ` Sam Ravnborg
2011-01-22  0:52 ` David Miller

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.