Re: [PATCH] power: cpupower: utils: Optimize print_online_cpus and print_offline_cpus function

From: Shuah Khan
Date: Thu Oct 13 2022 - 11:58:17 EST


On 10/12/22 20:01, Li kunyu wrote:

I'm glad to get your reply. In previous tests, it was found that variable initialization and assignment use mov related instructions. Therefore, when I analyze the code and find that removing some variable initialization and assignment does not affect the function and security, I will try to remove variable initialization.

Find the malloc function and find that its return value is void * type, so it does not need to cast.

thanks,
kunyu


I am not seeing any reasons for removing the initialization.
There is no need to do that.

Missing error handling after malloc() call is the real problem
that can be fixed in this code path.

If you would like to fix that, send me a patch for that.

Hmm. Your reply to list looks strange - please double check and fix it

"Re:[PATCH]"@lists.nfsmail.com etc...

thanks,
-- Shuah