projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
01d719a
)
NFC: Check for llcp_sock and its device from llcp_sock_getname
author
Samuel Ortiz
<sameo@linux.intel.com>
Thu, 5 Jul 2012 15:43:08 +0000
(17:43 +0200)
committer
John W. Linville
<linville@tuxdriver.com>
Mon, 9 Jul 2012 20:42:25 +0000
(16:42 -0400)
They both can potentially be NULL.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
net/nfc/llcp/sock.c
patch
|
blob
|
blame
|
history
diff --git
a/net/nfc/llcp/sock.c
b/net/nfc/llcp/sock.c
index 6152d05f83789f1ceb3107670c8739cd46770705..ddeb9aa398f0ced280fed93b853319923cf43c69 100644
(file)
--- a/
net/nfc/llcp/sock.c
+++ b/
net/nfc/llcp/sock.c
@@
-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);
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,
llcp_sock->dsap, llcp_sock->ssap);