From owner-svn-src-head@freebsd.org Thu Nov 19 00:27:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D911A3290C; Thu, 19 Nov 2015 00:27:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 085251E64; Thu, 19 Nov 2015 00:27:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAJ0RRoU022737; Thu, 19 Nov 2015 00:27:27 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAJ0RRbv022736; Thu, 19 Nov 2015 00:27:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511190027.tAJ0RRbv022736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 19 Nov 2015 00:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291045 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Nov 2015 00:27:28 -0000 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;