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]
Message-Id: <20240830014216.3464642-1-yanzhen@vivo.com>
Date: Fri, 30 Aug 2024 09:42:16 +0800
From: Yan Zhen <yanzhen@...o.com>
To: trondmy@...nel.org,
	anna@...nel.org,
	chuck.lever@...cle.com,
	jlayton@...nel.org,
	davem@...emloft.net,
	edumazet@...gle.com,
	kuba@...nel.org,
	pabeni@...hat.com
Cc: neilb@...e.de,
	okorniev@...hat.com,
	Dai.Ngo@...cle.com,
	tom@...pey.com,
	linux-nfs@...r.kernel.org,
	netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	opensource.kernel@...o.com,
	Yan Zhen <yanzhen@...o.com>
Subject: [PATCH net-next v1] sunrpc: Use ERR_CAST() to return

Using ERR_CAST() is more reasonable and safer, When it is necessary
to convert the type of an error pointer and return it.

Signed-off-by: Yan Zhen <yanzhen@...o.com>
---
 net/sunrpc/clnt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 09f29a95f2bc..8ee87311b348 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -603,7 +603,7 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
 
 	xprt = xprt_create_transport(&xprtargs);
 	if (IS_ERR(xprt))
-		return (struct rpc_clnt *)xprt;
+		return ERR_CAST(xprt);
 
 	/*
 	 * By default, kernel RPC client connects from a reserved port.
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ