Skip to content

Commit

Permalink
net: gptp: Fix gptp port number validation
Browse files Browse the repository at this point in the history
The gptp port number starts from 1, so the check was incorrect.
Use the proper define values before printing stats.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
  • Loading branch information
tgorochowik authored and nashif committed Jul 4, 2018
1 parent b51f1cc commit 214aebc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subsys/net/l2/ethernet/gptp/gptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ int gptp_get_port_data(struct gptp_domain *domain,
return -ENOENT;
}

if (port < 0 || port > CONFIG_NET_GPTP_NUM_PORTS) {
if (port < GPTP_PORT_START || port >= GPTP_PORT_END) {
return -EINVAL;
}

Expand Down

0 comments on commit 214aebc

Please sign in to comment.