x86/resctrl: Group struct rdt_hw_domain cleanup
domain_add_cpu() and domain_remove_cpu() need to kfree() the child arrays that were allocated by domain_setup_ctrlval(). As this memory is moved around, and new arrays are created, adjusting the error handling cleanup code becomes noisier. To simplify this, move all the kfree() calls into a domain_free() helper. This depends on struct rdt_hw_domain being kzalloc()d, allowing it to unconditionally kfree() all the child arrays. Signed-off-by: NJames Morse <james.morse@arm.com> Signed-off-by: NBorislav Petkov <bp@suse.de> Reviewed-by: NJamie Iles <quic_jiles@quicinc.com> Reviewed-by: NShaopeng Tan <tan.shaopeng@fujitsu.com> Reviewed-by: NReinette Chatre <reinette.chatre@intel.com> Tested-by: NXin Hao <xhao@linux.alibaba.com> Tested-by: NShaopeng Tan <tan.shaopeng@fujitsu.com> Tested-by: NCristian Marussi <cristian.marussi@arm.com> Link: https://lore.kernel.org/r/20220902154829.30399-5-james.morse@arm.com
Showing
想要评论请 注册 或 登录