提交 46b5ab1a 编写于 作者: D David Ahern 提交者: David S. Miller

net: dev: Fix non-RCU based lower dev walker

netdev_walk_all_lower_dev is not properly walking the lower device
list.  Commit 1a3f060c made netdev_walk_all_lower_dev similar
to netdev_walk_all_upper_dev_rcu and netdev_walk_all_lower_dev_rcu
but failed to update its netdev_next_lower_dev iterator. This patch
fixes that.

Fixes: 1a3f060c ("net: Introduce new api for walking upper and
                     lower devices")
Reported-by: NIdo Schimmel <idosch@mellanox.com>
Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
Tested-by: NIdo Schimmel <idosch@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b917783c
......@@ -5400,12 +5400,12 @@ static struct net_device *netdev_next_lower_dev(struct net_device *dev,
{
struct netdev_adjacent *lower;
lower = list_entry(*iter, struct netdev_adjacent, list);
lower = list_entry((*iter)->next, struct netdev_adjacent, list);
if (&lower->list == &dev->adj_list.lower)
return NULL;
*iter = lower->list.next;
*iter = &lower->list;
return lower->dev;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册