Commit 54b6a73
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>1 parent 9a41707 commit 54b6a73
1 file changed
+15
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5214 | 5214 | | |
5215 | 5215 | | |
5216 | 5216 | | |
5217 | | - | |
5218 | | - | |
5219 | | - | |
5220 | | - | |
| 5217 | + | |
| 5218 | + | |
5221 | 5219 | | |
5222 | 5220 | | |
5223 | | - | |
5224 | | - | |
5225 | | - | |
5226 | | - | |
5227 | | - | |
| 5221 | + | |
| 5222 | + | |
5228 | 5223 | | |
5229 | 5224 | | |
5230 | 5225 | | |
5231 | 5226 | | |
5232 | 5227 | | |
5233 | | - | |
5234 | | - | |
5235 | | - | |
| 5228 | + | |
| 5229 | + | |
5236 | 5230 | | |
5237 | 5231 | | |
5238 | 5232 | | |
| |||
5241 | 5235 | | |
5242 | 5236 | | |
5243 | 5237 | | |
5244 | | - | |
5245 | 5238 | | |
5246 | | - | |
| 5239 | + | |
| 5240 | + | |
| 5241 | + | |
| 5242 | + | |
| 5243 | + | |
| 5244 | + | |
| 5245 | + | |
| 5246 | + | |
| 5247 | + | |
5247 | 5248 | | |
5248 | 5249 | | |
5249 | 5250 | | |
| |||
0 commit comments