From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 21:41:37 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED54BD7A; Sun, 1 Mar 2015 21:41:37 +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 D87F69A4; Sun, 1 Mar 2015 21:41:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21LfbDP093342; Sun, 1 Mar 2015 21:41:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21Lfb3N093341; Sun, 1 Mar 2015 21:41:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503012141.t21Lfb3N093341@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 1 Mar 2015 21:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279502 - head/sys/fs/nandfs 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.18-1 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: Sun, 01 Mar 2015 21:41:38 -0000 Author: imp Date: Sun Mar 1 21:41:37 2015 New Revision: 279502 URL: https://svnweb.freebsd.org/changeset/base/279502 Log: nandfs_meta_bread() calls bread() which can set bp to NULL in some error cases. Calling brelse() with a NULL pointer is not allowed, so only call brelse() when the bp is non-NULL. Reported by: Maxime Villard (reported as uninitialized variable) Modified: head/sys/fs/nandfs/bmap.c Modified: head/sys/fs/nandfs/bmap.c ============================================================================== --- head/sys/fs/nandfs/bmap.c Sun Mar 1 21:41:35 2015 (r279501) +++ head/sys/fs/nandfs/bmap.c Sun Mar 1 21:41:37 2015 (r279502) @@ -317,7 +317,8 @@ bmap_truncate_indirect(struct nandfs_nod error = nandfs_bread_meta(node, lbn, NOCRED, 0, &bp); if (error) { - brelse(bp); + if (bp != NULL) + brelse(bp); return (error); }