diff options
author | cem <cem@FreeBSD.org> | 2015-11-19 00:27:26 +0000 |
---|---|---|
committer | cem <cem@FreeBSD.org> | 2015-11-19 00:27:26 +0000 |
commit | 8922a29059e11a919d3481ef569ef0b85dd5d909 (patch) | |
tree | f8703aa39c26acf55ddf98b47c820358b680bfbd /sys | |
parent | b75981aabc20f749744f5b8ca7e596ce3f276154 (diff) | |
download | FreeBSD-src-8922a29059e11a919d3481ef569ef0b85dd5d909.zip FreeBSD-src-8922a29059e11a919d3481ef569ef0b85dd5d909.tar.gz |
in6_mc_get: Fix recursion on if_addr_lock on malloc failure
Analogously to r291040, in6_mc_get recurses on if_addr_lock if the
M_NOWAIT allocation fails. The fix is the same.
Suggested by: Andrey V. Elsukov
Reviewed by: jhb (ip4 version)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D4138 (ip4 version)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet6/in6_mcast.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c index 4bc66e6..131130f 100644 --- a/sys/netinet6/in6_mcast.c +++ b/sys/netinet6/in6_mcast.c @@ -469,9 +469,9 @@ in6_mc_get(struct ifnet *ifp, const struct in6_addr *group, */ inm = malloc(sizeof(*inm), M_IP6MADDR, M_NOWAIT | M_ZERO); if (inm == NULL) { + IF_ADDR_WUNLOCK(ifp); if_delmulti_ifma(ifma); - error = ENOMEM; - goto out_locked; + return (ENOMEM); } inm->in6m_addr = *group; inm->in6m_ifp = ifp; |