From: Kristoffer Glembo Date: Tue, 18 Jan 2011 04:10:29 +0000 (+0000) Subject: sparc: Fix sbus_alloc_coherent error handling. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0c7c6a3c05f1d6d7e99fff0ca4056dce3ce07484;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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; }