Commit 6f8e4ad0 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

sock_diag: off by one checks

These tests are off by one because sock_diag_handlers[] only has AF_MAX
Signed-off-by: default avatarDan Carpenter <>
Acked-by: default avatarPavel Emelyanov <>
Signed-off-by: default avatarDavid S. Miller <>
parent 865d9f9f
......@@ -32,7 +32,7 @@ int sock_diag_register(struct sock_diag_handler *hndl)
int err = 0;
if (hndl->family > AF_MAX)
if (hndl->family >= AF_MAX)
return -EINVAL;
......@@ -50,7 +50,7 @@ void sock_diag_unregister(struct sock_diag_handler *hnld)
int family = hnld->family;
if (family > AF_MAX)
if (family >= AF_MAX)
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