summaryrefslogtreecommitdiff
path: root/net/ax25/af_ax25.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-01-04 15:25:34 (GMT)
committerAl Viro <viro@zeniv.linux.org.uk>2016-01-04 15:25:34 (GMT)
commit7e935c7ca1e6c398f11edac5beabfc4348e3b3a4 (patch)
tree86da864ba6341bd86b5f5450c611f918722237b2 /net/ax25/af_ax25.c
parentc62432b40b5e03c25faf2c8f8547bba4908b8945 (diff)
parente9d408e107db9a554b36c3a79f67b37dd3e16da0 (diff)
downloadlinux-7e935c7ca1e6c398f11edac5beabfc4348e3b3a4.tar.xz
Merge branch 'memdup_user_nul' into work.misc
Diffstat (limited to 'net/ax25/af_ax25.c')
-rw-r--r--net/ax25/af_ax25.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index ae3a47f..fbd0acf 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -805,6 +805,9 @@ static int ax25_create(struct net *net, struct socket *sock, int protocol,
struct sock *sk;
ax25_cb *ax25;
+ if (protocol < 0 || protocol > SK_PROTOCOL_MAX)
+ return -EINVAL;
+
if (!net_eq(net, &init_net))
return -EAFNOSUPPORT;