Commit 4caa1239 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[IPV4,6]: Fix off-by-one in max protocol-type check

parent 39a98687
......@@ -978,7 +978,7 @@ void inet_register_protosw(struct inet_protosw *p)
spin_lock_bh(&inetsw_lock);
if (p->type > SOCK_MAX)
if (p->type >= SOCK_MAX)
goto out_illegal;
/* If we are trying to override a permanent protocol, bail. */
......
......@@ -572,7 +572,7 @@ inet6_register_protosw(struct inet_protosw *p)
spin_lock_bh(&inetsw6_lock);
if (p->type > SOCK_MAX)
if (p->type >= SOCK_MAX)
goto out_illegal;
/* If we are trying to override a permanent protocol, bail. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment