On Sun, Mar 27, 2022 at 02:01:20PM +0800, Xiaomeng Tong wrote:
These three bugs are here: struct gbaudio_data_connection *data;
If the list '&codec->module_list' is empty then the 'data' will keep unchanged.
All three of these functions check for if the codec->module_list is empty at the start of the function so these are not real bugs.
Smatch is supposed to be able to figure this out, but apparently that code is broken so Smatch still prints a warning. :(
Apparently GCC does not print a warning for this. Even when I delete the check for list_empty() then GCC does not print a warning. GCC often assumes that we enter loops one time. I haven't looked at that, but I have noticed it in reviewing Smatch vs GCC warnings.
Generally we do not apply static checker work arounds.
I do not have a problem with this particular work around, but it needs an updated commit message which says it is just to silence static checker warnings and not to fix bugs. Remove the Fixes tag. Don't CC stable.
regards, dan carpenter