aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/most/aim-network/networking.c
diff options
context:
space:
mode:
authorAndrey Shvetsov <andrey.shvetsov@k2l.de>2017-05-12 12:59:55 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-15 11:59:09 +0200
commiteec3546cb92a5dbb84e817692d306a5db6e6f416 (patch)
tree930bcf312344b936b11b556701ca056bfdea67cc /drivers/staging/most/aim-network/networking.c
parentstaging: most: remove dependency on networking-aim (diff)
downloadlinux-dev-eec3546cb92a5dbb84e817692d306a5db6e6f416.tar.xz
linux-dev-eec3546cb92a5dbb84e817692d306a5db6e6f416.zip
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: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
-rw-r--r--drivers/staging/most/aim-network/networking.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/most/aim-network/networking.c b/drivers/staging/most/aim-network/networking.c
index a3009fdfa278..11f03d3cd565 100644
--- a/drivers/staging/most/aim-network/networking.c
+++ b/drivers/staging/most/aim-network/networking.c
@@ -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;