From owner-svn-src-all@freebsd.org Fri May 27 23:44:34 2016 Return-Path: Delivered-To: svn-src-all@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 DEE9EB4D7BF; Fri, 27 May 2016 23:44:34 +0000 (UTC) (envelope-from np@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 AC58519FA; Fri, 27 May 2016 23:44:34 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RNiXeI013664; Fri, 27 May 2016 23:44:33 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RNiX5P013663; Fri, 27 May 2016 23:44:33 GMT (envelope-from np@FreeBSD.org) Message-Id: <201605272344.u4RNiX5P013663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 27 May 2016 23:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300888 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 23:44:35 -0000 Author: np Date: Fri May 27 23:44:33 2016 New Revision: 300888 URL: https://svnweb.freebsd.org/changeset/base/300888 Log: iw_cxgbe: Plug a lock leak in process_mpa_request(). If the parent is DEAD or connect_request_upcall() fails, the parent mutex is left locked. This leads to a hang when process_mpa_request() is called again for another child of the listening endpoint. Submitted by: Krishnamraju Eraparaju @ Chelsio Obtained from: upstream iw_cxgb4 Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Fri May 27 23:15:58 2016 (r300887) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Fri May 27 23:44:33 2016 (r300888) @@ -1861,14 +1861,16 @@ process_mpa_request(struct c4iw_ep *ep) /* drive upcall */ mutex_lock(&ep->parent_ep->com.mutex); if (ep->parent_ep->com.state != DEAD) { - if(connect_request_upcall(ep)) - goto err_out; - }else { - goto err_out; - } + if (connect_request_upcall(ep)) + goto err_unlock_parent; + } else + goto err_unlock_parent; mutex_unlock(&ep->parent_ep->com.mutex); return 0; +err_unlock_parent: + mutex_unlock(&ep->parent_ep->com.mutex); + goto err_out; err_stop_timer: STOP_EP_TIMER(ep); err_out: