* [patch] hsr: off by one sanity check in hsr_register_frame_in()
@ 2014-02-28 23:18 Dan Carpenter
2014-03-03 20:30 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-02-28 23:18 UTC (permalink / raw)
To: Arvid Brodin; +Cc: David S. Miller, netdev, kernel-janitors
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 <dan.carpenter@oracle.com>
diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c
index 3d0100f0bae3..83e58449366a 100644
--- a/net/hsr/hsr_framereg.c
+++ b/net/hsr/hsr_framereg.c
@@ -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;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] hsr: off by one sanity check in hsr_register_frame_in()
2014-02-28 23:18 [patch] hsr: off by one sanity check in hsr_register_frame_in() Dan Carpenter
@ 2014-03-03 20:30 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-03-03 20:30 UTC (permalink / raw)
To: dan.carpenter; +Cc: arvid.brodin, netdev, kernel-janitors
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Sat, 1 Mar 2014 02:18:57 +0300
> 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 <dan.carpenter@oracle.com>
Applied, thanks Dan.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-03-03 20:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-28 23:18 [patch] hsr: off by one sanity check in hsr_register_frame_in() Dan Carpenter
2014-03-03 20:30 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).