From: Kristoffer Glembo Date: Tue, 18 Jan 2011 04:10:29 +0000 (+0000) Subject: sparc: Fix sbus_alloc_coherent error handling. X-Git-Tag: firefly_0821_release~7613^2~2187^2~27 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0c7c6a3c05f1d6d7e99fff0ca4056dce3ce07484;p=firefly-linux-kernel-4.4.55.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; }