aboutsummaryrefslogtreecommitdiffstats
path: root/net/can/bcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/can/bcm.c')
-rw-r--r--net/can/bcm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/can/bcm.c b/net/can/bcm.c
index e32af52238a2..907dc871fac8 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -56,6 +56,7 @@
56#include <linux/can.h> 56#include <linux/can.h>
57#include <linux/can/core.h> 57#include <linux/can/core.h>
58#include <linux/can/bcm.h> 58#include <linux/can/bcm.h>
59#include <linux/slab.h>
59#include <net/sock.h> 60#include <net/sock.h>
60#include <net/net_namespace.h> 61#include <net/net_namespace.h>
61 62
@@ -1478,6 +1479,9 @@ static int bcm_connect(struct socket *sock, struct sockaddr *uaddr, int len,
1478 struct sock *sk = sock->sk; 1479 struct sock *sk = sock->sk;
1479 struct bcm_sock *bo = bcm_sk(sk); 1480 struct bcm_sock *bo = bcm_sk(sk);
1480 1481
1482 if (len < sizeof(*addr))
1483 return -EINVAL;
1484
1481 if (bo->bound) 1485 if (bo->bound)
1482 return -EISCONN; 1486 return -EISCONN;
1483 1487