提交 c100c8f4 编写于 作者: D 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: NDave Jones <davej@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c3794745
......@@ -1051,16 +1051,17 @@ static int atalk_release(struct socket *sock)
{
struct sock *sk = sock->sk;
sock_hold(sk);
lock_sock(sk);
if (sk) {
sock_hold(sk);
lock_sock(sk);
sock_orphan(sk);
sock->sk = NULL;
atalk_destroy_socket(sk);
}
release_sock(sk);
sock_put(sk);
release_sock(sk);
sock_put(sk);
}
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册