From owner-svn-src-head@FreeBSD.ORG Mon Feb 2 23:41:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9D61990; Mon, 2 Feb 2015 23:41:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C62AB7C7; Mon, 2 Feb 2015 23:41:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t12Nfiv9063913; Mon, 2 Feb 2015 23:41:44 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t12NfiBW063912; Mon, 2 Feb 2015 23:41:44 GMT (envelope-from np@FreeBSD.org) Message-Id: <201502022341.t12NfiBW063912@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 2 Feb 2015 23:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278117 - head/sys/ofed/include/linux 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.18-1 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: Mon, 02 Feb 2015 23:41:45 -0000 Author: np Date: Mon Feb 2 23:41:43 2015 New Revision: 278117 URL: https://svnweb.freebsd.org/changeset/base/278117 Log: Fix bug in idr_pre_get where it doesn't handle 'need' correctly. Obtained from: Chelsio Communications' internal repository. Modified: head/sys/ofed/include/linux/linux_idr.c Modified: head/sys/ofed/include/linux/linux_idr.c ============================================================================== --- head/sys/ofed/include/linux/linux_idr.c Mon Feb 2 21:09:26 2015 (r278116) +++ head/sys/ofed/include/linux/linux_idr.c Mon Feb 2 23:41:43 2015 (r278117) @@ -223,7 +223,7 @@ idr_pre_get(struct idr *idr, gfp_t gfp_m for (il = idr->free; il != NULL; il = il->ary[0]) need--; mtx_unlock(&idr->lock); - if (need == 0) + if (need <= 0) break; for (head = NULL; need; need--) { iln = malloc(sizeof(*il), M_IDR, M_ZERO | gfp_mask);