From 0c7c6a3c05f1d6d7e99fff0ca4056dce3ce07484 Mon Sep 17 00:00:00 2001 From: Kristoffer Glembo Date: Tue, 18 Jan 2011 04:10:29 +0000 Subject: [PATCH] sparc: Fix sbus_alloc_coherent error handling. Order of kfree and free_pages were swapped in the error handling. Signed-off-by: Kristoffer Glembo Acked-by: Sam Ravnborg Signed-off-by: David S. Miller --- arch/sparc/kernel/ioport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index bd4fb10748b1..c6ce9a6a4790 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; } -- 2.20.1