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.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/can/raw.c b/net/can/raw.c
index b5e897922d32..da99cf153b33 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -45,6 +45,7 @@
45#include <linux/init.h> 45#include <linux/init.h>
46#include <linux/uio.h> 46#include <linux/uio.h>
47#include <linux/net.h> 47#include <linux/net.h>
48#include <linux/slab.h>
48#include <linux/netdevice.h> 49#include <linux/netdevice.h>
49#include <linux/socket.h> 50#include <linux/socket.h>
50#include <linux/if_arp.h> 51#include <linux/if_arp.h>
@@ -424,8 +425,6 @@ static int raw_setsockopt(struct socket *sock, int level, int optname,
424 425
425 if (level != SOL_CAN_RAW) 426 if (level != SOL_CAN_RAW)
426 return -EINVAL; 427 return -EINVAL;
427 if (optlen < 0)
428 return -EINVAL;
429 428
430 switch (optname) { 429 switch (optname) {
431 430
@@ -446,7 +445,7 @@ static int raw_setsockopt(struct socket *sock, int level, int optname,
446 return -EFAULT; 445 return -EFAULT;
447 } 446 }
448 } else if (count == 1) { 447 } else if (count == 1) {
449 if (copy_from_user(&sfilter, optval, optlen)) 448 if (copy_from_user(&sfilter, optval, sizeof(sfilter)))
450 return -EFAULT; 449 return -EFAULT;
451 } 450 }
452 451
@@ -702,7 +701,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct socket *sock,
702 return err; 701 return err;
703 } 702 }
704 703
705 sock_recv_timestamp(msg, sk, skb); 704 sock_recv_ts_and_drops(msg, sk, skb);
706 705
707 if (msg->msg_name) { 706 if (msg->msg_name) {
708 msg->msg_namelen = sizeof(struct sockaddr_can); 707 msg->msg_namelen = sizeof(struct sockaddr_can);
@@ -744,7 +743,6 @@ static struct proto raw_proto __read_mostly = {
744static struct can_proto raw_can_proto __read_mostly = { 743static struct can_proto raw_can_proto __read_mostly = {
745 .type = SOCK_RAW, 744 .type = SOCK_RAW,
746 .protocol = CAN_RAW, 745 .protocol = CAN_RAW,
747 .capability = -1,
748 .ops = &raw_ops, 746 .ops = &raw_ops,
749 .prot = &raw_proto, 747 .prot = &raw_proto,
750}; 748};