Blackfin: sram_free_with_lsl: do not ignore return value of sram_free
authorMike Frysinger <vapier@gentoo.org>
Mon, 6 Dec 2010 21:12:23 +0000 (21:12 +0000)
committerMike Frysinger <vapier@gentoo.org>
Mon, 10 Jan 2011 12:18:26 +0000 (07:18 -0500)
If there was an error in the lower free functions, we need to pass that
back up so the calling process is able to check things.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
arch/blackfin/mm/sram-alloc.c

index 627e04b5ba9a8979be2149ecff27e52f6bb05458..dfd304a4a3ea113a25f23befd8ba8f0078b4bc79 100644 (file)
@@ -704,18 +704,18 @@ int sram_free_with_lsl(const void *addr)
 {
        struct sram_list_struct *lsl, **tmp;
        struct mm_struct *mm = current->mm;
+       int ret = -1;
 
        for (tmp = &mm->context.sram_list; *tmp; tmp = &(*tmp)->next)
-               if ((*tmp)->addr == addr)
-                       goto found;
-       return -1;
-found:
-       lsl = *tmp;
-       sram_free(addr);
-       *tmp = lsl->next;
-       kfree(lsl);
+               if ((*tmp)->addr == addr) {
+                       lsl = *tmp;
+                       ret = sram_free(addr);
+                       *tmp = lsl->next;
+                       kfree(lsl);
+                       break;
+               }
 
-       return 0;
+       return ret;
 }
 EXPORT_SYMBOL(sram_free_with_lsl);