Skip to content

Commit

Permalink
hsr: off by one sanity check in hsr_register_frame_in()
Browse files Browse the repository at this point in the history
This is a sanity check and we never pass invalid values so this patch
doesn't change anything.  However the node->time_in[] array has
HSR_MAX_SLAVE (2) elements and not HSR_MAX_DEV (3).

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Dan Carpenter authored and davem330 committed Mar 3, 2014
1 parent 635d61a commit de39d7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/hsr/hsr_framereg.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ static bool seq_nr_after(u16 a, u16 b)

void hsr_register_frame_in(struct node_entry *node, enum hsr_dev_idx dev_idx)
{
if ((dev_idx < 0) || (dev_idx >= HSR_MAX_DEV)) {
if ((dev_idx < 0) || (dev_idx >= HSR_MAX_SLAVE)) {
WARN_ONCE(1, "%s: Invalid dev_idx (%d)\n", __func__, dev_idx);
return;
}
Expand Down

0 comments on commit de39d7a

Please sign in to comment.