On Fri, 3 Jul 2020 14:56:36 +0800 Chengguang Xu <cgxu519@xxxxxxxxxxxx> wrote: > new_attr is allocated with kvmalloc() so should be freed > with kvfree(). > > ... > > --- a/mm/shmem.c > +++ b/mm/shmem.c > @@ -3178,7 +3178,7 @@ static int shmem_initxattrs(struct inode *inode, > new_xattr->name = kmalloc(XATTR_SECURITY_PREFIX_LEN + len, > GFP_KERNEL); > if (!new_xattr->name) { > - kfree(new_xattr); > + kvfree(new_xattr); > return -ENOMEM; > } Indeed. Maybe simple_xattr_alloc() should have been called simple_xattr_kvmalloc().