netfilter: x_tables: add and use xt_check_entry_offsets
[firefly-linux-kernel-4.4.55.git] / net / irda / af_irda.c
index e6aa48b5395c67e2600eed9482c97b9a626d01bd..923abd6b3064074f39f84644b2d3d1f068403f51 100644 (file)
@@ -1086,6 +1086,9 @@ static int irda_create(struct net *net, struct socket *sock, int protocol,
        struct sock *sk;
        struct irda_sock *self;
 
+       if (protocol < 0 || protocol > SK_PROTOCOL_MAX)
+               return -EINVAL;
+
        if (net != &init_net)
                return -EAFNOSUPPORT;