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: Vinay Krishna Eranna <veran@codeaurora.org>
This commit is contained in:
Vinay Krishna Eranna 2014-06-26 21:39:03 +05:30 committed by Gerrit - the friendly Code Review server
parent dee710f640
commit 6059ddb2dd
1 changed files with 3 additions and 3 deletions

View File

@ -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;