sparc: Fix sbus_alloc_coherent error handling.
authorKristoffer Glembo <kristoffer@gaisler.com>
Tue, 18 Jan 2011 04:10:29 +0000 (04:10 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Mar 2011 01:18:59 +0000 (18:18 -0700)
Order of kfree and free_pages were swapped in the error handling.

Signed-off-by: Kristoffer Glembo <kristoffer@gaisler.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/ioport.c

index bd4fb10748b1478568a1412bfba652086dea3bad..c6ce9a6a47902bc8a5339bf77ecb08b111a72ea0 100644 (file)
@@ -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;
 }