Commit 1561b326 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

selftests/net: rxtimestamp: Fix an off by one

The > should be >= so that we don't write one element beyond the end of
the array.

Fixes: 16e78122 ("selftests/net: Add a test to validate behavior of rx timestamps")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7a92616c
......@@ -341,7 +341,7 @@ int main(int argc, char **argv)
return 0;
case 'n':
t = atoi(optarg);
if (t > ARRAY_SIZE(test_cases))
if (t >= ARRAY_SIZE(test_cases))
error(1, 0, "Invalid test case: %d", t);
all_tests = false;
test_cases[t].enabled = true;
......
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