Re: [PATCH v2 05/23] x86/resctrl: Add domain online callback for resctrl work
From: James Morse
Date: Fri Oct 22 2021 - 14:30:33 EST
Hi Reinette,
On 15/10/2021 23:19, Reinette Chatre wrote:
> On 10/1/2021 9:02 AM, James Morse wrote:
>
>> @@ -527,21 +492,15 @@ static void domain_add_cpu(int cpu, struct rdt_resource *r)
>> return;
>> }
>> - if (r->mon_capable && domain_setup_mon_state(r, d)) {
>> - kfree(hw_dom->ctrl_val);
>> - kfree(hw_dom->mbps_val);
>> - kfree(hw_dom);
>> - return;
>> - }
>> -
>> list_add_tail(&d->list, add_pos);
>> - /*
>> - * If resctrl is mounted, add
>> - * per domain monitor data directories.
>> - */
>> - if (static_branch_unlikely(&rdt_mon_enable_key))
>> - mkdir_mondata_subdir_allrdtgrp(r, d);
>> + err = resctrl_online_domain(r, d);
>> + if (err) {
>> + list_del(&d->list);
>> + kfree(hw_dom->ctrl_val);
>> + kfree(hw_dom->mbps_val);
>> + kfree(d);
>
> Even though this goes away in next patch I think this should rather be kfree(hw_dom).
Whoops, that's a rebase artefact from patch 2. Fixed.
Thanks!
James