From nobody Tue Mar 21 15:59:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PgxBG1HmKz40T2c; Tue, 21 Mar 2023 15:59:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PgxBG0dBNz3kdT; Tue, 21 Mar 2023 15:59:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679414374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDk/342zaQuwvTvUAoixpbhA3Ns3PRBkF3uKNiJbs84=; b=H2ikYlMAYUgSPsLVRrlukKwuhXZP+kFU42XitEabOYBOUZKQbudpsneVm5jv/Fn/Rd1GIe a51XbzuwFSHtkjdJOD6G1jBnkZhz7rFhgJpfoA75aCf6HYITnSAkirioNnc2+P40cSrJgd ZyAUnuuGSEBQnGUtviYAcPsrJDOCFBoZnhrUP/ynwN7jQouIqSUeZBY5WzfdLmd8HjnqMQ WJYxAfa+7cl/xC9/m4S1ny4UjBGwDmlbqqjWv+NkQjsSr0LoGVmRcQLFf/66t5Q398ilAq 15EWlvUpVAUecUVf9hmTGszP+120dw2qjw6KQDmXdy9aQdC6UHZw3/39DzWECg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679414374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDk/342zaQuwvTvUAoixpbhA3Ns3PRBkF3uKNiJbs84=; b=T5U3942+OaC/5KKfgVn7XQg1w/VvnQdbP3i8F24w0IZ0rJujV7Yd+I1ZaTc0uiD7HHQa8c yfjzdtorDOre7zNY7FbimuGbl1J65G4EDJdG2Zo4cqhNTcjRH8c/mPmulx/2H88GWZpczx oSLNyEkiFF6WhFkc13kNT0/s46d9r9ccIxtw+48H0D46AO2TFQ/0qQ2iray74mPtvFn3lj aC6kommP7OOW1VqCo3fLKfTgdA8eGVw9pTTapj1TVyRM4bXlL/hzfuMseD/pf7BnGfba48 1L/6SdjeDiLwWS3PsFA0tSXRo8jB9jaL4vbU5m1hMCjPAOsvIDrlaePhrRk5RA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679414374; a=rsa-sha256; cv=none; b=vPD5c9Wb7KazgfMsPa81Wnwv/LMh3QHNnJtJybKvoBtTyk1sfFT4B10l6gF6oAbXcgVmMS U6NSLh0+yQVpPES1wLQcmjsJAik9G3uQE+W/DTe77QxfnIHM9bjsbgU+YT1GPVXhFhDAUt P8Th3choX0mQanbpoAVLMIkm1fW8ZbEtH52vFR3KkBBjzQeEzUvz5lh/Wb/aPNsJb6J79o +vXmdSB+dYhG4envI88MpTPfXwoRUiQxeT3j8eOAKNHPG9ZEHX9g7H53xX00n01apBsgvL MLYs3G3U66ulvyJpQNZnSLwGHSeajD7yY2BD5CkpCxbj1pn99Z49r49CxqbeGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PgxBF6j1FzHtY; Tue, 21 Mar 2023 15:59:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32LFxXox075430; Tue, 21 Mar 2023 15:59:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32LFxXbg075429; Tue, 21 Mar 2023 15:59:33 GMT (envelope-from git) Date: Tue, 21 Mar 2023 15:59:33 GMT Message-Id: <202303211559.32LFxXbg075429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: a16159aa2e33 - stable/13 - makefs: do not call brelse if bread returns an error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a16159aa2e3358c9c89242627558707faf8f499f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a16159aa2e3358c9c89242627558707faf8f499f commit a16159aa2e3358c9c89242627558707faf8f499f Author: Ed Maste AuthorDate: 2023-03-13 20:51:51 +0000 Commit: Ed Maste CommitDate: 2023-03-21 15:58:40 +0000 makefs: do not call brelse if bread returns an error If bread returns an error there is no bp to brelse. One of these changes was taken from NetBSD commit 0a62dad69f62 ("This works well enough to populate..."), the rest were found by looking for the same pattern. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39069 (cherry picked from commit bc33c99234a676c41cde63cce389dd6b8b70adfc) --- usr.sbin/makefs/ffs/ffs_alloc.c | 2 -- usr.sbin/makefs/msdos/msdosfs_lookup.c | 4 ---- 2 files changed, 6 deletions(-) diff --git a/usr.sbin/makefs/ffs/ffs_alloc.c b/usr.sbin/makefs/ffs/ffs_alloc.c index b5fbb4111685..69cba0454b5f 100644 --- a/usr.sbin/makefs/ffs/ffs_alloc.c +++ b/usr.sbin/makefs/ffs/ffs_alloc.c @@ -305,7 +305,6 @@ ffs_alloccg(struct inode *ip, int cg, daddr_t bpref, int size) error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, NULL, &bp); if (error) { - brelse(bp); return (0); } cgp = (struct cg *)bp->b_data; @@ -449,7 +448,6 @@ ffs_blkfree(struct inode *ip, daddr_t bno, long size) error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, NULL, &bp); if (error) { - brelse(bp); return; } cgp = (struct cg *)bp->b_data; diff --git a/usr.sbin/makefs/msdos/msdosfs_lookup.c b/usr.sbin/makefs/msdos/msdosfs_lookup.c index dd6acb7ee37c..cebaad69e7d4 100644 --- a/usr.sbin/makefs/msdos/msdosfs_lookup.c +++ b/usr.sbin/makefs/msdos/msdosfs_lookup.c @@ -126,7 +126,6 @@ createde(struct denode *dep, struct denode *ddep, struct denode **depp, if (dirclust != MSDOSFSROOT) diroffset &= pmp->pm_crbomask; if ((error = bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp)) != 0) { - brelse(bp); return error; } ndep = bptoep(pmp, bp, ddep->de_fndoffset); @@ -158,7 +157,6 @@ createde(struct denode *dep, struct denode *ddep, struct denode **depp, error = bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp); if (error) { - brelse(bp); return error; } ndep = bptoep(pmp, bp, ddep->de_fndoffset); @@ -213,7 +211,6 @@ readep(struct msdosfsmount *pmp, u_long dirclust, u_long diroffset, blsize = de_bn2off(pmp, pmp->pm_rootdirsize) & pmp->pm_crbomask; bn = detobn(pmp, dirclust, diroffset); if ((error = bread(pmp->pm_devvp, bn, blsize, NOCRED, bpp)) != 0) { - brelse(*bpp); *bpp = NULL; return (error); } @@ -273,7 +270,6 @@ uniqdosname(struct denode *dep, struct componentname *cnp, u_char *cp) } error = bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp); if (error) { - brelse(bp); return error; } for (dentp = (struct direntry *)bp->b_data;