Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6059ddb2 authored by Vinay Krishna Eranna's avatar Vinay Krishna Eranna Committed by Gerrit - the friendly Code Review server
Browse files

netlink: Queue the kernel socket after setting the flag.



Queueing the socket after setting the NETLINK_KERNEL_SOCKET on the
kernel socket.

This change is required in-order to avoid the BUG check which is
caused due to race condition between setting this flag and a
message from the app space for this kernel netlink sock.

Change-Id: I19a8edf2fe009a3020b194684a6172654f8f257a
CRs-Fixed: 681815
Signed-off-by: default avatarVinay Krishna Eranna <veran@codeaurora.org>
parent dee710f6
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2268,12 +2268,12 @@ __netlink_kernel_create(struct net *net, int unit, struct module *module,
	if (cfg && cfg->input)
		nlk_sk(sk)->netlink_rcv = cfg->input;

	if (netlink_insert(sk, net, 0))
		goto out_sock_release;

	nlk = nlk_sk(sk);
	nlk->flags |= NETLINK_KERNEL_SOCKET;

	if (netlink_insert(sk, net, 0))
		goto out_sock_release;

	netlink_table_grab();
	if (!nl_table[unit].registered) {
		nl_table[unit].groups = groups;