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-next>] [day] [month] [year] [list]
Date:   Wed, 29 Sep 2021 17:16:26 +0800
From:   dingsenjie@....com
To:     bfields@...ldses.org, chuck.lever@...cle.com
Cc:     linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org,
        dingsenjie <dingsenjie@...ong.com>
Subject: [PATCH] fs: nfsd: Simplify the return expression of numeric_name_to_id

From: dingsenjie <dingsenjie@...ong.com>

Simplify the return expression in the nfs4idmap.c

Signed-off-by: dingsenjie <dingsenjie@...ong.com>
---
 fs/nfsd/nfs4idmap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index f92161c..dc5926c 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -603,7 +603,6 @@ static __be32 idmap_id_to_name(struct xdr_stream *xdr,
 static bool
 numeric_name_to_id(struct svc_rqst *rqstp, int type, const char *name, u32 namelen, u32 *id)
 {
-	int ret;
 	char buf[11];
 
 	if (namelen + 1 > sizeof(buf))
@@ -612,8 +611,7 @@ static __be32 idmap_id_to_name(struct xdr_stream *xdr,
 	/* Just to make sure it's null-terminated: */
 	memcpy(buf, name, namelen);
 	buf[namelen] = '\0';
-	ret = kstrtouint(buf, 10, id);
-	return ret == 0;
+	return kstrtouint(buf, 10, id) == 0;
 }
 
 static __be32
-- 
1.9.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ