[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1762481859.4201689-2-xuanzhuo@linux.alibaba.com>
Date: Fri, 7 Nov 2025 10:17:39 +0800
From: Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Wen Gu <guwen@...ux.alibaba.com>,
Philo Lu <lulie@...ux.alibaba.com>,
Lorenzo Bianconi <lorenzo@...nel.org>,
Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
Lukas Bulwahn <lukas.bulwahn@...hat.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Vivian Wang <wangruikang@...as.ac.cn>,
Troy Mitchell <troy.mitchell@...ux.spacemit.com>,
Dust Li <dust.li@...ux.alibaba.com>
Subject: Re: [PATCH net-next v10 3/5] eea: probe the netdevice and create adminq
On Thu, 6 Nov 2025 18:13:28 -0800, Jakub Kicinski <kuba@...nel.org> wrote:
> On Fri, 7 Nov 2025 10:04:12 +0800 Xuan Zhuo wrote:
> > > > + struct eea_aq_cfg *cfg __free(kfree) = NULL;
> > > > + int err;
> > > > + u32 mtu;
> > > > +
> > > > + cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
> > > > + if (!cfg)
> > > > + return -ENOMEM;
> > > > +
> > > > + err = eea_adminq_query_cfg(enet, cfg);
> > > > + if (err)
> > > > + return err;
> > >
> > > AFAICT this is leaking cfg
> >
> > cfg is freed by __free(kfree).
>
> Oh, sorry, please read:
> https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#using-device-managed-and-cleanup-h-constructs
> don't use __free() in drivers.
OK.
>
Powered by blists - more mailing lists