Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: dsa: avoid refcount warnings when ds->ops->tag_8021q_vlan_del() fails

This is very similar to the problem and solution from commit
232deb3f9567 ("net: dsa: avoid refcount warnings when
->port_{fdb,mdb}_del returns error"), except for the
dsa_port_do_tag_8021q_vlan_del() operation.

Fixes: c64b9c05045a ("net: dsa: tag_8021q: add proper cross-chip notifier support")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20250414213020.2959021-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Vladimir Oltean and committed by
Jakub Kicinski
514eff7b 8bf108d7

+1 -1
+1 -1
net/dsa/tag_8021q.c
··· 197 197 198 198 err = ds->ops->tag_8021q_vlan_del(ds, port, vid); 199 199 if (err) { 200 - refcount_inc(&v->refcount); 200 + refcount_set(&v->refcount, 1); 201 201 return err; 202 202 } 203 203