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

Commit 4ded928c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 58239a8b c47ee101
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -72,11 +72,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;
@@ -109,6 +111,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;
}