RE: wifi: iwlwifi: Fix uninitialized variable with __free()

From: Korenblit, Miriam Rachel
Date: Wed Mar 12 2025 - 16:33:49 EST




> -----Original Message-----
> From: Markus Elfring <Markus.Elfring@xxxxxx>
> Sent: Wednesday, 12 March 2025 22:17
> To: Korenblit, Miriam Rachel <miriam.rachel.korenblit@xxxxxxxxx>; Dan
> Carpenter <dan.carpenter@xxxxxxxxxx>; linux-wireless@xxxxxxxxxxxxxxx
> Cc: kernel-janitors@xxxxxxxxxxxxxxx; LKML <linux-kernel@xxxxxxxxxxxxxxx>;
> Anjaneyulu, Pagadala Yesu <pagadala.yesu.anjaneyulu@xxxxxxxxx>; Stern,
> Avraham <avraham.stern@xxxxxxxxx>; Gabay, Daniel <daniel.gabay@xxxxxxxxx>;
> Grumbach, Emmanuel <emmanuel.grumbach@xxxxxxxxx>; Jeff Johnson
> <jeff.johnson@xxxxxxxxxxxxxxxx>; Berg, Johannes <johannes.berg@xxxxxxxxx>;
> Ben Shimol, Yedidya <yedidya.ben.shimol@xxxxxxxxx>
> Subject: Re: wifi: iwlwifi: Fix uninitialized variable with __free()
>
> >> Can it be recommended to reduce the scope for the affected local variable
> instead?
> >> https://elixir.bootlin.com/linux/v6.14-rc6/source/include/linux/clean
> >> up.h#L129-L133
> >
> > As said in reply to Jeff's review -
> > This is recommended if you have multiple __kfree variables (and the
> > order of freeing matters) Or if there is a guard() later in the function.
> How does such a view fit to the documentation of this programming interface?

Did you read about the possible bug that leads to this recommendation?
https://elixir.bootlin.com/linux/v6.14-rc6/source/include/linux/cleanup.h#L64-L127