netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lib80211: Use ERR_CAST() to return
@ 2024-09-06 11:44 Rohit Chavan
  2024-09-06 11:54 ` Johannes Berg
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Rohit Chavan @ 2024-09-06 11:44 UTC (permalink / raw)
  To: Johannes Berg, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, linux-wireless, netdev, linux-kernel
  Cc: Rohit Chavan

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: Rohit Chavan <roheetchavan@gmail.com>
---
 net/wireless/lib80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/wireless/lib80211.c b/net/wireless/lib80211.c
index d66a913027e0..87c0e09aa676 100644
--- a/net/wireless/lib80211.c
+++ b/net/wireless/lib80211.c
@@ -227,7 +227,7 @@ EXPORT_SYMBOL(lib80211_get_crypto_ops);
 
 static void *lib80211_crypt_null_init(int keyidx)
 {
-	return (void *)1;
+	return ERR_CAST(1);
 }
 
 static void lib80211_crypt_null_deinit(void *priv)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-09-07 21:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-06 11:44 [PATCH] lib80211: Use ERR_CAST() to return Rohit Chavan
2024-09-06 11:54 ` Johannes Berg
2024-09-06 19:08 ` Simon Horman
2024-09-07  7:47 ` kernel test robot
2024-09-07  7:47 ` kernel test robot
2024-09-07 20:08 ` Al Viro
2024-09-07 21:49 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).