Commit eec3546c authored by Andrey Shvetsov's avatar Andrey Shvetsov Committed by Greg Kroah-Hartman

staging: most: use unsafe version of list traversing

The function get_net_dev_context does not remove elements of the list.
Hence, list traversing does not need to be secured.

This patch replaces list_for_each_entry_safe with the
list_for_each_entry.
Signed-off-by: default avatarAndrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d35bbfaa
......@@ -290,11 +290,11 @@ static void most_net_rm_netdev_safe(struct net_dev_context *nd)
static struct net_dev_context *get_net_dev_context(
struct most_interface *iface)
{
struct net_dev_context *nd, *tmp;
struct net_dev_context *nd;
unsigned long flags;
spin_lock_irqsave(&list_lock, flags);
list_for_each_entry_safe(nd, tmp, &net_devices, list) {
list_for_each_entry(nd, &net_devices, list) {
if (nd->iface == iface) {
spin_unlock_irqrestore(&list_lock, flags);
return nd;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment