We need to free "ctx" before returning on this error path. Fixes: 1ec2b51af007 ("afs: Add fs_context support") Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> diff --git a/fs/afs/super.c b/fs/afs/super.c index 656f810c5234..037f20f5ee90 100644 --- a/fs/afs/super.c +++ b/fs/afs/super.c @@ -596,8 +596,10 @@ static int afs_init_fs_context(struct fs_context *fc, struct dentry *reference) break; case FS_CONTEXT_FOR_SUBMOUNT: - if (!reference) + if (!reference) { + kfree(ctx); return -EINVAL; + } src_as = AFS_FS_S(reference->d_sb); ASSERT(src_as); -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html