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]
Message-ID: <223a61e9-f826-4f37-b514-ca6ed53b1269@web.de>
Date: Sun, 31 Dec 2023 18:44:13 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: netdev@...r.kernel.org, kernel-janitors@...r.kernel.org,
 Anjali Kulkarni <anjali.k.kulkarni@...cle.com>,
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Kuniyuki Iwashima <kuniyu@...zon.com>,
 Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH 2/4] netlink: Move an assignment for the variable “sk” in __netlink_kernel_create()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sun, 31 Dec 2023 17:36:50 +0100

Move one assignment for the variable “sk” closer to the place
where this pointer is used.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 net/netlink/af_netlink.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index c3f88015cacf..b71d9c21d15b 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2033,8 +2033,6 @@ __netlink_kernel_create(struct net *net, int unit, struct module *module,
 	if (__netlink_create(net, sock, cb_mutex, unit, 1) < 0)
 		goto out_sock_release_nosk;

-	sk = sock->sk;
-
 	if (!cfg || cfg->groups < 32)
 		groups = 32;
 	else
@@ -2044,6 +2042,7 @@ __netlink_kernel_create(struct net *net, int unit, struct module *module,
 	if (!listeners)
 		goto out_netlink_release_sock;

+	sk = sock->sk;
 	sk->sk_data_ready = netlink_data_ready;
 	if (cfg && cfg->input)
 		nlk_sk(sk)->netlink_rcv = cfg->input;
--
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ