Skip to contentSkip to conversation

hsr: off by one sanity check in hsr_register_frame_in()

PATCH Applied Dan Carpenter 2 participants 2 messages Feb 28, 2014 – Mar 3, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hsr: off by one sanity check in hsr_register_frame_in()

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).

net/hsr/hsr_framereg.c +1 -1
index 3d0100f0bae3..83e58449366a 100644
@@ -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;
 	}
maintainer Applied
#1 lore raw

From: Dan Carpenter <[email protected]>
Date: Sat, 1 Mar 2014 02:18:57 +0300

Quoted 5 lines

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).

Applied, thanks Dan.