Commit c100c8f4 authored by David S. Miller's avatar David S. Miller

appletalk: Fix OOPS in atalk_release().

Commit 60d9f461 ("appletalk: remove
the BKL") added a dereference of "sk" before checking for NULL in
atalk_release().

Guard the code block completely, rather than partially, with the
NULL check.
Reported-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c3794745
...@@ -1051,16 +1051,17 @@ static int atalk_release(struct socket *sock) ...@@ -1051,16 +1051,17 @@ static int atalk_release(struct socket *sock)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
if (sk) {
sock_hold(sk); sock_hold(sk);
lock_sock(sk); lock_sock(sk);
if (sk) {
sock_orphan(sk); sock_orphan(sk);
sock->sk = NULL; sock->sk = NULL;
atalk_destroy_socket(sk); atalk_destroy_socket(sk);
}
release_sock(sk); release_sock(sk);
sock_put(sk); sock_put(sk);
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment