diff options
Diffstat (limited to 'net/can/raw.c')
-rw-r--r-- | net/can/raw.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/can/raw.c b/net/can/raw.c index 69877b8e7e9c..3e46ee36a1aa 100644 --- a/net/can/raw.c +++ b/net/can/raw.c | |||
@@ -632,6 +632,9 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
632 | } else | 632 | } else |
633 | ifindex = ro->ifindex; | 633 | ifindex = ro->ifindex; |
634 | 634 | ||
635 | if (size != sizeof(struct can_frame)) | ||
636 | return -EINVAL; | ||
637 | |||
635 | dev = dev_get_by_index(&init_net, ifindex); | 638 | dev = dev_get_by_index(&init_net, ifindex); |
636 | if (!dev) | 639 | if (!dev) |
637 | return -ENXIO; | 640 | return -ENXIO; |