]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/can/raw.c
twl4030 "subdriver" irq tweaks
[linux-2.6-omap-h63xx.git] / net / can / raw.c
index 69877b8e7e9c772be9479bced40b6b8273662322..6e0663faaf9fcdea78d0f57947489e429d764cdd 100644 (file)
@@ -210,7 +210,7 @@ static int raw_notifier(struct notifier_block *nb,
        struct raw_sock *ro = container_of(nb, struct raw_sock, notifier);
        struct sock *sk = &ro->sk;
 
-       if (dev_net(dev) != &init_net)
+       if (!net_eq(dev_net(dev), &init_net))
                return NOTIFY_DONE;
 
        if (dev->type != ARPHRD_CAN)
@@ -632,6 +632,9 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock,
        } else
                ifindex = ro->ifindex;
 
+       if (size != sizeof(struct can_frame))
+               return -EINVAL;
+
        dev = dev_get_by_index(&init_net, ifindex);
        if (!dev)
                return -ENXIO;