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

Commit a5ccce19 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net: sockev: avoid races between sockev and socket_close"

parents dbd2cda6 06a383eb
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -73,11 +73,13 @@ static int sockev_client_cb(struct notifier_block *nb,

	sock = (struct socket *)data;
	if (!socknlmsgsk || !sock)
		goto done;
		goto sk_null;

	sk = sock->sk;
	if (!sk)
		goto done;
		goto sk_null;

	sock_hold(sk);

	if (sk->sk_family != AF_INET && sk->sk_family != AF_INET6)
		goto done;
@@ -108,6 +110,8 @@ static int sockev_client_cb(struct notifier_block *nb,
	smsg->skflags = sk->sk_flags;
	nlmsg_notify(socknlmsgsk, skb, 0, SKNLGRP_SOCKEV, 0, GFP_KERNEL);
done:
	sock_put(sk);
sk_null:
	return 0;
}