lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 05 Jul 2015 15:32:21 +0200
From:	SF Markus Elfring <elfring@...rs.sourceforge.net>
To:	Joel Becker <jlbec@...lplan.org>, Mark Fasheh <mfasheh@...e.com>,
	ocfs2-devel@....oracle.com
CC:	LKML <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org,
	Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 04/11] ocfs2: One check less in ocfs2_statfs()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sat, 4 Jul 2015 16:28:50 +0200

Delete a check for the variable "status" by adjustment of two jump targets
according to the Linux coding style convention.
Separate the exception handling statements from the ordinary execution path.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 fs/ocfs2/super.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 37e418f..ed16f08 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1692,14 +1692,12 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
 	if (!inode) {
 		mlog(ML_ERROR, "failed to get bitmap inode\n");
 		status = -EIO;
-		goto bail;
+		goto log_error;
 	}
 
 	status = ocfs2_inode_lock(inode, &bh, 0);
-	if (status < 0) {
-		mlog_errno(status);
-		goto bail;
-	}
+	if (status < 0)
+		goto put_inode;
 
 	bm_lock = (struct ocfs2_dinode *) bh->b_data;
 
@@ -1724,13 +1722,12 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
 	brelse(bh);
 
 	ocfs2_inode_unlock(inode, 0);
-	status = 0;
-bail:
 	iput(inode);
-
-	if (status)
-		mlog_errno(status);
-
+	return 0;
+put_inode:
+	iput(inode);
+log_error:
+	mlog_errno(status);
 	return status;
 }
 
-- 
2.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ