Commit fe3c094a authored by Samuel Ortiz's avatar Samuel Ortiz Committed by John W. Linville

NFC: Check for llcp_sock and its device from llcp_sock_getname

They both can potentially be NULL.
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 01d719a2
...@@ -294,6 +294,9 @@ static int llcp_sock_getname(struct socket *sock, struct sockaddr *uaddr, ...@@ -294,6 +294,9 @@ static int llcp_sock_getname(struct socket *sock, struct sockaddr *uaddr,
struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk); struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk);
DECLARE_SOCKADDR(struct sockaddr_nfc_llcp *, llcp_addr, uaddr); DECLARE_SOCKADDR(struct sockaddr_nfc_llcp *, llcp_addr, uaddr);
if (llcp_sock == NULL || llcp_sock->dev == NULL)
return -EBADFD;
pr_debug("%p %d %d %d\n", sk, llcp_sock->target_idx, pr_debug("%p %d %d %d\n", sk, llcp_sock->target_idx,
llcp_sock->dsap, llcp_sock->ssap); llcp_sock->dsap, llcp_sock->ssap);
......
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