]> git.baikalelectronics.ru Git - kernel.git/commit
slub: fix leak of 'name' in sysfs_slab_add
authorDave Jones <davej@fedoraproject.org>
Mon, 7 Apr 2014 22:39:32 +0000 (15:39 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 7 Apr 2014 23:36:13 +0000 (16:36 -0700)
commit735bdd8c7ee736ba1cef73bc69ed0112e52350e8
tree7db33948c9ab6fb39b31d275185e0ce55315ac03
parent8a57bff8dd9947a838de39d50fd9932925199cb2
slub: fix leak of 'name' in sysfs_slab_add

The failure paths of sysfs_slab_add don't release the allocation of
'name' made by create_unique_id() a few lines above the context of the
diff below.  Create a common exit path to make it more obvious what
needs freeing.

[vdavydov@parallels.com: free the name only if !unmergeable]
Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/slub.c