Skip to content

Commit

Permalink
x86/intel_rdt: Fix memory leak on mount failure
Browse files Browse the repository at this point in the history
If mount fails, the kn_info directory is not freed causing memory leak.

Add the missing error handling path.

Fixes: 4e978d0 ("x86/intel_rdt: Add "info" files to resctrl file system")
Signed-off-by: Vikas Shivappa <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
  • Loading branch information
Vikas Shivappa authored and KAGA-KOKO committed Jun 30, 2017
1 parent 8eabf42 commit 79298ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,11 +856,13 @@ static struct dentry *rdt_mount(struct file_system_type *fs_type,
dentry = kernfs_mount(fs_type, flags, rdt_root,
RDTGROUP_SUPER_MAGIC, NULL);
if (IS_ERR(dentry))
goto out_cdp;
goto out_destroy;

static_branch_enable(&rdt_enable_key);
goto out;

out_destroy:
kernfs_remove(kn_info);
out_cdp:
cdp_disable();
out:
Expand Down

0 comments on commit 79298ac

Please sign in to comment.