git: c850ca3a1716 - stable/13 - Retore the vnet before returning an error.
George V. Neville-Neil
gnn at FreeBSD.org
Sun Sep 5 22:33:29 UTC 2021
The branch stable/13 has been updated by gnn:
URL: https://cgit.FreeBSD.org/src/commit/?id=c850ca3a1716424a757e6064180fcae4703de37f
commit c850ca3a1716424a757e6064180fcae4703de37f
Author: George V. Neville-Neil <gnn at FreeBSD.org>
AuthorDate: 2021-06-21 14:46:20 +0000
Commit: George V. Neville-Neil <gnn at FreeBSD.org>
CommitDate: 2021-09-05 22:25:44 +0000
Retore the vnet before returning an error.
Obtained from: Kanndula, Dheeraj <Dheeraj.Kandula at netapp.com>
(cherry picked from commit c6b2d024d7eedbf32f52a17bc029c92f5a4d1a54)
---
sys/net/if_vlan.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 3114a3f8b76c..10a254d22440 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -613,6 +613,7 @@ vlan_setmulti(struct ifnet *ifp)
mc = malloc(sizeof(struct vlan_mc_entry), M_VLAN, M_NOWAIT);
if (mc == NULL) {
IF_ADDR_WUNLOCK(ifp);
+ CURVNET_RESTORE();
return (ENOMEM);
}
bcopy(ifma->ifma_addr, &mc->mc_addr, ifma->ifma_addr->sa_len);
@@ -623,8 +624,10 @@ vlan_setmulti(struct ifnet *ifp)
CK_SLIST_FOREACH (mc, &sc->vlan_mc_listhead, mc_entries) {
error = if_addmulti(ifp_p, (struct sockaddr *)&mc->mc_addr,
NULL);
- if (error)
+ if (error) {
+ CURVNET_RESTORE();
return (error);
+ }
}
CURVNET_RESTORE();
More information about the dev-commits-src-all
mailing list