mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
BACKPORT: net: Make sock protocol value checks more specific
SK_PROTOCOL_MAX is only used in two places, for DECNet and AX.25. The limits have more to do with the those protocol definitions than they do with the data type of sk_protocol, so remove SK_PROTOCOL_MAX and use U8_MAX directly. Reviewed-by: Eric Dumazet <[email protected]> Change-Id: Iff043154c9081bd274a73cb55895940f1873546f Signed-off-by: Mat Martineau <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
237c9da728
commit
19836e3a03
2 changed files with 1 additions and 2 deletions
|
|
@ -831,7 +831,7 @@ 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)
|
||||
if (protocol < 0 || protocol > U8_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
if (!net_eq(net, &init_net))
|
||||
|
|
|
|||
Loading…
Reference in a new issue