Author: cem
Date: Thu Nov 19 00:27:26 2015
New Revision: 291045
URL: https://svnweb.freebsd.org/changeset/base/291045

Log:
  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)

Modified:
  head/sys/netinet6/in6_mcast.c

Modified: head/sys/netinet6/in6_mcast.c
==============================================================================
--- head/sys/netinet6/in6_mcast.c       Thu Nov 19 00:25:58 2015        
(r291044)
+++ head/sys/netinet6/in6_mcast.c       Thu Nov 19 00:27:26 2015        
(r291045)
@@ -469,9 +469,9 @@ in6_mc_get(struct ifnet *ifp, const stru
         */
        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;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to