Re: [PATCH net-next] net: dsa: motorcomm: Free the MIB block on port teardown

From
Andrew Lunn <andrew@lunn.ch>
Date
2026-11-08 16:50:35
Also in
lkml
Reply to
David Yang, 2026-11-08
quoted hunk ↗ jump to hunk
@@ -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
Thread (4 messages) 4 messages, 3 authors, last reply 15h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help