Skip to content

Commit d4ebfca

Browse files
James Morsesuryasaimadhu
authored andcommitted
x86/resctrl: Fix kfree() of the wrong type in domain_add_cpu()
Commit in Fixes separated the architecture specific and filesystem parts of the resctrl domain structures. This left the error paths in domain_add_cpu() kfree()ing the memory with the wrong type. This will cause a problem if someone adds a new member to struct rdt_hw_domain meaning d_resctrl is no longer the first member. Fixes: 792e0f6 ("x86/resctrl: Split struct rdt_domain") Signed-off-by: James Morse <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Acked-by: Reinette Chatre <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 64e87d4 commit d4ebfca

File tree

1 file changed

+2
-2
lines changed
  • arch/x86/kernel/cpu/resctrl

1 file changed

+2
-2
lines changed

arch/x86/kernel/cpu/resctrl/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,14 +527,14 @@ static void domain_add_cpu(int cpu, struct rdt_resource *r)
527527
rdt_domain_reconfigure_cdp(r);
528528

529529
if (r->alloc_capable && domain_setup_ctrlval(r, d)) {
530-
kfree(d);
530+
kfree(hw_dom);
531531
return;
532532
}
533533

534534
if (r->mon_capable && domain_setup_mon_state(r, d)) {
535535
kfree(hw_dom->ctrl_val);
536536
kfree(hw_dom->mbps_val);
537-
kfree(d);
537+
kfree(hw_dom);
538538
return;
539539
}
540540

0 commit comments

Comments
 (0)