aboutsummaryrefslogtreecommitdiffstats
path: root/net/can/raw.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/can/raw.c')
-rw-r--r--net/can/raw.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/can/raw.c b/net/can/raw.c
index e88f610fdb7b..883e9d74fddf 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -649,6 +649,9 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock,
649 struct sockaddr_can *addr = 649 struct sockaddr_can *addr =
650 (struct sockaddr_can *)msg->msg_name; 650 (struct sockaddr_can *)msg->msg_name;
651 651
652 if (msg->msg_namelen < sizeof(*addr))
653 return -EINVAL;
654
652 if (addr->can_family != AF_CAN) 655 if (addr->can_family != AF_CAN)
653 return -EINVAL; 656 return -EINVAL;
654 657