On Tue, Apr 04, 2023 at 03:22:09PM +0800, xiongxin wrote: > In the memory allocation of rp->domains in rapl_detect_domains(), there > is an additional memory of struct rapl_domain allocated to prevent the > pointer out of bounds called later. > > Optimize the code here to save sizeof(struct rapl_domain) bytes of > memory. > > Test in Intel NUC (i5-1135G7). > > Cc: stable@xxxxxxxxxxxxxxx > Signed-off-by: xiongxin <xiongxin@xxxxxxxxxx> > Tested-by: xiongxin <xiongxin@xxxxxxxxxx> > --- > drivers/powercap/intel_rapl_common.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > <formletter> This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly. </formletter>