From: Jakub Kicinski <kuba@kernel.org>
To: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Wen Gu <guwen@linux.alibaba.com>,
Philo Lu <lulie@linux.alibaba.com>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Lukas Bulwahn <lukas.bulwahn@redhat.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Vivian Wang <wangruikang@iscas.ac.cn>,
Troy Mitchell <troy.mitchell@linux.spacemit.com>,
Dust Li <dust.li@linux.alibaba.com>
Subject: Re: [PATCH net-next v10 3/5] eea: probe the netdevice and create adminq
Date: Thu, 6 Nov 2025 18:13:28 -0800 [thread overview]
Message-ID: <20251106181328.25661cea@kernel.org> (raw)
In-Reply-To: <1762481052.9107397-1-xuanzhuo@linux.alibaba.com>
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.
next prev parent reply other threads:[~2025-11-07 2:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-05 1:34 [PATCH net-next v10 0/5] eea: Add basic driver framework for Alibaba Elastic Ethernet Adaptor Xuan Zhuo
2025-11-05 1:34 ` [PATCH net-next v10 1/5] eea: introduce PCI framework Xuan Zhuo
2025-11-08 15:42 ` Simon Horman
2025-11-05 1:34 ` [PATCH net-next v10 2/5] eea: introduce ring and descriptor structures Xuan Zhuo
2025-11-05 1:34 ` [PATCH net-next v10 3/5] eea: probe the netdevice and create adminq Xuan Zhuo
2025-11-07 2:01 ` Jakub Kicinski
2025-11-07 2:04 ` Xuan Zhuo
2025-11-07 2:13 ` Jakub Kicinski [this message]
2025-11-07 2:17 ` Xuan Zhuo
2025-11-05 1:34 ` [PATCH net-next v10 4/5] eea: create/destroy rx,tx queues for netdevice open and stop Xuan Zhuo
2025-11-05 1:34 ` [PATCH net-next v10 5/5] eea: introduce ethtool support Xuan Zhuo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251106181328.25661cea@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=dust.li@linux.alibaba.com \
--cc=edumazet@google.com \
--cc=geert+renesas@glider.be \
--cc=guwen@linux.alibaba.com \
--cc=lorenzo@kernel.org \
--cc=lukas.bulwahn@redhat.com \
--cc=lulie@linux.alibaba.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=troy.mitchell@linux.spacemit.com \
--cc=vadim.fedorenko@linux.dev \
--cc=wangruikang@iscas.ac.cn \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).