提交 0c318359 编写于 作者: S Samuel Ortiz 提交者: John W. Linville

NFC: Unlink LLCP child sockets from llcp_sock_release

The parent socket (the bound one) could be freed before its children, so
we should unlink the children without trying to reach it through the parent.
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 2fbabfa4
......@@ -327,20 +327,10 @@ static int llcp_sock_release(struct socket *sock)
mutex_lock(&local->socket_lock);
if (llcp_sock == local->sockets[llcp_sock->ssap]) {
if (llcp_sock == local->sockets[llcp_sock->ssap])
local->sockets[llcp_sock->ssap] = NULL;
} else {
struct nfc_llcp_sock *parent, *s, *n;
parent = local->sockets[llcp_sock->ssap];
list_for_each_entry_safe(s, n, &parent->list, list)
if (llcp_sock == s) {
list_del(&s->list);
break;
}
}
else
list_del(&llcp_sock->list);
mutex_unlock(&local->socket_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册