2012/8/8 Christoph Lameter (Open Source) <cl@xxxxxxxxx>: > On Sun, 5 Aug 2012, JoonSoo Kim wrote: > >> We can remove some comment for name param of __kmem_cache_create() in slab.c. > > Ok. > >> We need to remove CONFIG_DEBUG_VM for out_locked now, >> although later patch handles it. > > Ok. > >> > + } else { >> > + kfree(n); >> > + err = -ENOSYS; /* Until __kmem_cache_create returns code */ >> > + } >> >> In mergeable case, leak for name is possible. >> __kmem_cache_create() doesn't set name to s->name in mergeable case. >> So, this memory can't be freed. > > If __kmem_cache_create() finds a mergeable cache and returns a pointer > to another cache then then this branch wont be taken since s != NULL. I means that if we find mergeable cache, we don't use n (from kstrdup), but it is already allocated. So it should be freed in this case. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>