diff options
Diffstat (limited to 'net/ieee802154/af_ieee802154.c')
-rw-r--r-- | net/ieee802154/af_ieee802154.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ieee802154/af_ieee802154.c b/net/ieee802154/af_ieee802154.c index bad1c49fd960..c7da600750bb 100644 --- a/net/ieee802154/af_ieee802154.c +++ b/net/ieee802154/af_ieee802154.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/if.h> | 28 | #include <linux/if.h> |
29 | #include <linux/termios.h> /* For TIOCOUTQ/INQ */ | 29 | #include <linux/termios.h> /* For TIOCOUTQ/INQ */ |
30 | #include <linux/list.h> | 30 | #include <linux/list.h> |
31 | #include <linux/slab.h> | ||
31 | #include <net/datalink.h> | 32 | #include <net/datalink.h> |
32 | #include <net/psnap.h> | 33 | #include <net/psnap.h> |
33 | #include <net/sock.h> | 34 | #include <net/sock.h> |
@@ -126,6 +127,9 @@ static int ieee802154_sock_connect(struct socket *sock, struct sockaddr *uaddr, | |||
126 | { | 127 | { |
127 | struct sock *sk = sock->sk; | 128 | struct sock *sk = sock->sk; |
128 | 129 | ||
130 | if (addr_len < sizeof(uaddr->sa_family)) | ||
131 | return -EINVAL; | ||
132 | |||
129 | if (uaddr->sa_family == AF_UNSPEC) | 133 | if (uaddr->sa_family == AF_UNSPEC) |
130 | return sk->sk_prot->disconnect(sk, flags); | 134 | return sk->sk_prot->disconnect(sk, flags); |
131 | 135 | ||