On Sat, 2025-11-08 at 16:36 +0000, Simon Horman wrote: [..] > > Please don't do it that way. It's not C++ with RAII and > > declare-where-you-use. > > Just leave the variable declarations where they are, but initialize them > > with `= NULL`. > > > > Variable declarations must be in one block and sorted from the longest > > to the shortest. > > > > But most important, I'm not even sure how you could trigger an > > "undefined behaviour" here. Both here and below the variable tagged with > > `__free` is initialized right after the declaration block, before any > > return. So how to trigger an UB here? > > FWIIW, I'd prefer if we sidestepped this discussion entirely > by not using __free [1] in this driver. > > It seems to me that for both functions updated by this > patch that can easily be achieved using an idiomatic > goto label to free on error. > > [1] > https://docs.kernel.org/process/maintainer-netdev.html#using-device-managed-and-cleanup-h-constructs > > ...
Understood. I will come-up with a new patch series for removing these two instances Regards, Ally
