summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorJoonsoo Kim <js1304@gmail.com>2012-05-11 00:32:59 +0900
committerPekka Enberg <penberg@kernel.org>2012-05-16 09:37:25 +0300
commit601d39d00c2af206d10d1252132a85316d95499a (patch)
tree49cba676d0106e6310b3a5dc560f2b477fd79fea /mm
parent9fe496116e966902f5efe593d946222a649ea5c8 (diff)
downloadblackbird-op-linux-601d39d00c2af206d10d1252132a85316d95499a.tar.gz
blackbird-op-linux-601d39d00c2af206d10d1252132a85316d95499a.zip
slub: fix a possible memory leak
Memory allocated by kstrdup should be freed, when kmalloc(kmem_size, GFP_KERNEL) is failed. Acked-by: Christoph Lameter <cl@linux.com> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Joonsoo Kim <js1304@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/slub.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 18bf13eac54b..60119f78ccc0 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3968,9 +3968,9 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
}
return s;
}
- kfree(n);
kfree(s);
}
+ kfree(n);
err:
up_write(&slub_lock);
OpenPOWER on IntegriCloud