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

Commit 674f2115 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

ipx: fix ipx_release()



Commit b0d0d915 (remove the BKL) added a regression, because
sock_put() can free memory while we are going to use it later.

Fix is to delay sock_put() _after_ release_sock().

Reported-by: default avatarIngo Molnar <mingo@elte.hu>
Tested-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 20246a80
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,6 @@ static void ipx_destroy_socket(struct sock *sk)
	ipx_remove_socket(sk);
	skb_queue_purge(&sk->sk_receive_queue);
	sk_refcnt_debug_dec(sk);
	sock_put(sk);
}

/*
@@ -1404,6 +1403,7 @@ static int ipx_release(struct socket *sock)
	sk_refcnt_debug_release(sk);
	ipx_destroy_socket(sk);
	release_sock(sk);
	sock_put(sk);
out:
	return 0;
}