From: Andrew Lunn <andrew@lunn.ch>
To: David Yang <mmyangfl@gmail.com>
Cc: netdev@vger.kernel.org, Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: dsa: motorcomm: Free the MIB block on port teardown
Date: Sun, 8 Nov 2026 17:50:29 +0100 [thread overview]
Message-ID: <aaed4927-d124-438a-8526-2b8f51ca3732@lunn.ch> (raw)
In-Reply-To: <20261108101648.1308271-1-mmyangfl@gmail.com>
> @@ -2006,12 +2006,11 @@ static int yt921x_dsa_port_setup(struct dsa_switch *ds, int port)
> struct yt921x_priv *priv = dsa_to_yt921x_priv(ds);
> struct yt921x_port *pp = &priv->ports[port];
> const struct yt921x_info *info = priv->info;
> - struct device *dev = yt921x_priv_to_device(priv);
> struct yt921x_mib *pm = pp->mib;
> int res;
>
> if (!pm && (BIT(port) & yt921x_info_ports_mask(info))) {
> - pm = devm_kzalloc(dev, sizeof(*pm), GFP_KERNEL);
> + pm = kvzalloc_obj(*pm);
Is the if (!pm still needed?
Andrew
next prev parent reply other threads:[~2026-11-08 16:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-08 10:15 David Yang
2026-11-08 10:22 ` netdev-bot+sinfo
2026-11-08 10:33 ` David Yang
2026-11-08 16:50 ` Andrew Lunn [this message]
2026-11-09 10:46 ` netdev-bot+sashiko
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=aaed4927-d124-438a-8526-2b8f51ca3732@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmyangfl@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.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
all inboxes | Powered by JetHome®