From: Akinobu Mita Date: Thu, 15 Nov 2007 00:58:35 +0000 (-0800) Subject: slab: fix typo in allocation failure handling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cc550defe9790b495c96fafabc5a6528dc586f24;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git slab: fix typo in allocation failure handling This patch fixes wrong array index in allocation failure handling. Cc: Pekka Enberg Acked-by: Christoph Lameter Signed-off-by: Akinobu Mita Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/slab.c b/mm/slab.c index cfa6be4e378..c31cd3682a0 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -1043,7 +1043,7 @@ static struct array_cache **alloc_alien_cache(int node, int limit) } ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d); if (!ac_ptr[i]) { - for (i--; i <= 0; i--) + for (i--; i >= 0; i--) kfree(ac_ptr[i]); kfree(ac_ptr); return NULL;