[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240810035318.GD13701@ZenIV>
Date: Sat, 10 Aug 2024 04:53:18 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Christian Brauner <brauner@...nel.org>
Cc: viro@...nel.org, linux-fsdevel@...r.kernel.org, amir73il@...il.com,
bpf@...r.kernel.org, cgroups@...r.kernel.org, kvm@...r.kernel.org,
netdev@...r.kernel.org, torvalds@...ux-foundation.org
Subject: Re: [PATCH 36/39] assorted variants of irqfd setup: convert to
CLASS(fd)
On Wed, Aug 07, 2024 at 12:46:35PM +0200, Christian Brauner wrote:
> On Tue, Jul 30, 2024 at 01:16:22AM GMT, viro@...nel.org wrote:
> > From: Al Viro <viro@...iv.linux.org.uk>
> >
> > in all of those failure exits prior to fdget() are plain returns and
> > the only thing done after fdput() is (on failure exits) a kfree(),
>
> They could also be converted to:
>
> struct virqfd *virqfd __free(kfree) = NULL;
>
> and then direct returns are usable.
No. They could be converted, but kfree() is *not* the right
destructor for that thing. This is a good example of the
reasons why __cleanup should not be used blindly - this
"oh, we'll just return, this object will be taken care of
automagically" would better really take care of the object.
Look for goto error_eventfd; in there...
Powered by blists - more mailing lists