From nobody Tue Mar 14 02:41:25 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 4PbHpY6X29z3xY56; Tue, 14 Mar 2023 02:41:25 +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 4PbHpY5yH1z3xMp; Tue, 14 Mar 2023 02:41:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678761685; 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=q7qzaauhGJxhkqPyc/x+1siV7+cqhngJ6fSIIWHrSTU=; b=R8kHENW9SyBugX0avUtuzuqVFkqeMJ/BLB1Tk0bLUR5zw/jKyyBtUvrqyTjiSGMGnyrnQ0 a4Oyt9w2cwynG5kOTI0RofoSHdx69hET2snT7cK06IrhiVCa71ChB6XaUwbiuBke0epZsX LugBff4FAIOcIhlmNUL0MWD7ibEEPrAktzwu6rbPohoXFeQBV/rxB8QQ+lXj8P/JVVfIqY t6GgMbZSnXWYlfEZVyuJ6FTQXf9M3y7qvYJTBxRtX/+hU6FpOwZLlCUFecIzf9Q0LPabMN gLVim1CzwdiI+mzLUgmqiXmVKaggmwEnqWwopGEB/EIET1Od6bWYXb2uf5m04Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678761685; 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=q7qzaauhGJxhkqPyc/x+1siV7+cqhngJ6fSIIWHrSTU=; b=dcWekhb7gpl85IUEZzToOiDNmEOy3zaeRQcIdb+HEql9e767dS4nmhbfrU/WYkGJl7s2mJ rz8w+zB3qDlFjXsL+Iy75qpUqpsGJPTTsHSfb1a9hZR97SeU+UB4oOlGDMtHJwOPtz2JVJ Vjvwmpb5g/s4CpnG7rMNgYasdYs8ljZO+JZLL8+MItp4Y/ZKieKutCg/fX0uQ4PQgD5Hji ZXOtHbsKBb22uADJezZ97dAnXJdWa2kt3UVo+Votih4CKA5zEwcexGbvP/F2GllLhpgmL1 fE7sZxEvYIqbsZG5/Vgjr0zSAfCSP59HaHAJt4egVui1Y08Kxj8pwHdY+PKYWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678761685; a=rsa-sha256; cv=none; b=DAUB8HMwvNugVkdW9RjMcFHsFUyu1S93ClB/ngn4/TvkvAqtsCLEQBb7IoTvzuWZOhbxnh KqwClxr6qCMBe7POIgZee/MD7HY4DatDewNUoDvi+WZRr76dPZhqjlcG6z9SH56UupW8ds 520x53iLumDQY/r37BNb9BPJ3yp78tJwBt3FZsVhaiKUWiXL7MoOxxKyHvT65Kpro3KsUO 3cfexJeHf2/adLN3pMkzpQIcy2V69umpamHKNErfFqr3JI5lmdpZNZwcbsZZVTdVCtqELM D9X8eWgS3O6aG8RaSozlUwppIiW7hFMenOV0/3xjcemJaQe+Q17UR7kX3siWhQ== 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 4PbHpY518pzJG6; Tue, 14 Mar 2023 02:41:25 +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 32E2fPOE004458; Tue, 14 Mar 2023 02:41:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32E2fPf2004457; Tue, 14 Mar 2023 02:41:25 GMT (envelope-from git) Date: Tue, 14 Mar 2023 02:41:25 GMT Message-Id: <202303140241.32E2fPf2004457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: bc33c99234a6 - main - 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/main X-Git-Reftype: branch X-Git-Commit: bc33c99234a676c41cde63cce389dd6b8b70adfc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=bc33c99234a676c41cde63cce389dd6b8b70adfc commit bc33c99234a676c41cde63cce389dd6b8b70adfc Author: Ed Maste AuthorDate: 2023-03-13 20:51:51 +0000 Commit: Ed Maste CommitDate: 2023-03-14 02:39:09 +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 --- 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 ff0e72c56af0..4dee635fba96 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((void *)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((void *)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 fb2f4deceaf2..68fee52cdd88 100644 --- a/usr.sbin/makefs/msdos/msdosfs_lookup.c +++ b/usr.sbin/makefs/msdos/msdosfs_lookup.c @@ -125,7 +125,6 @@ createde(struct denode *dep, struct denode *ddep, struct denode **depp, diroffset &= pmp->pm_crbomask; if ((error = bread((void *)pmp->pm_devvp, bn, blsize, NOCRED, &bp)) != 0) { - brelse(bp); return error; } ndep = bptoep(pmp, bp, ddep->de_fndoffset); @@ -157,7 +156,6 @@ createde(struct denode *dep, struct denode *ddep, struct denode **depp, error = bread((void *)pmp->pm_devvp, bn, blsize, NOCRED, &bp); if (error) { - brelse(bp); return error; } ndep = bptoep(pmp, bp, ddep->de_fndoffset); @@ -213,7 +211,6 @@ m_readep(struct msdosfsmount *pmp, u_long dirclust, u_long diroffset, bn = detobn(pmp, dirclust, diroffset); if ((error = bread((void *)pmp->pm_devvp, bn, blsize, NOCRED, bpp)) != 0) { - brelse(*bpp); *bpp = NULL; return (error); } @@ -274,7 +271,6 @@ uniqdosname(struct denode *dep, struct componentname *cnp, u_char *cp) error = bread((void *)pmp->pm_devvp, bn, blsize, NOCRED, &bp); if (error) { - brelse(bp); return error; } for (dentp = (struct direntry *)bp->b_data;