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

Commit 1a044660 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 bf111665 76a699e7
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -57,11 +57,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;
@@ -92,6 +94,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;
}