Re: [PATCH net-next] net: fec: Convert fec driver to use lock guards

From: Eric Dumazet
Date: Tue May 07 2024 - 06:40:22 EST


On Tue, May 7, 2024 at 11:16 AM Wei Fang <wei.fang@xxxxxxx> wrote:
>
> Use guard() and scoped_guard() defined in linux/cleanup.h to automate
> lock lifetime control in fec driver.
>
> Signed-off-by: Wei Fang <wei.fang@xxxxxxx>
>

To me, this looks like a nice recipe for future disasters when doing backports,
because I am pretty sure the "goto ..." that assumes the lock is
magically released
will fail horribly.

I would use scoped_guard() only for new code.