quota: remove an unneeded condition

This change “quota: remove an unneeded condition” in Linux kernel is authored by Dan Carpenter <dan.carpenter [at] oracle.com> on Tue Aug 11 00:29:55 2015 +0300.

quota: remove an unneeded condition

We know "ret" is zero here so we can remove this condition.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jan Kara <jack@suse.com>

This Linux change may have been applied to various maintained Linux releases and you can find Linux releases including commit 72d4d0e.

There are 4 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 fs/quota/quota.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/quota/quota.c b/fs/quota/quota.c
index 86ded73..3746367 100644
--- a/fs/quota/quota.c
+++ b/fs/quota/quota.c
@@ -141,9 +141,9 @@ static int quota_getinfo(struct super_block *sb, int type, void __user *addr)
 	if (tstate->flags & QCI_ROOT_SQUASH)
 		uinfo.dqi_flags |= DQF_ROOT_SQUASH;
 	uinfo.dqi_valid = IIF_ALL;
-	if (!ret && copy_to_user(addr, &uinfo, sizeof(uinfo)))
+	if (copy_to_user(addr, &uinfo, sizeof(uinfo)))
 		return -EFAULT;
-	return ret;
+	return 0;
 static int quota_setinfo(struct super_block *sb, int type, void __user *addr)

The commit for this change in Linux stable tree is 72d4d0e (patch).

Leave a Reply

Your email address will not be published. Required fields are marked *