USB: kl5usb105: minor clean ups
[firefly-linux-kernel-4.4.55.git] / net / can / bcm.c
index a2dee522b43e8c2e9540fd5783cefd4022ce16ee..907dc871fac8bcf5e6d3cbce2c79f9a53706ccfa 100644 (file)
@@ -1479,6 +1479,9 @@ static int bcm_connect(struct socket *sock, struct sockaddr *uaddr, int len,
        struct sock *sk = sock->sk;
        struct bcm_sock *bo = bcm_sk(sk);
 
+       if (len < sizeof(*addr))
+               return -EINVAL;
+
        if (bo->bound)
                return -EISCONN;