]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: most: use unsafe version of list traversing
authorAndrey Shvetsov <andrey.shvetsov@k2l.de>
Fri, 12 May 2017 10:59:55 +0000 (12:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 May 2017 09:59:09 +0000 (11:59 +0200)
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>
drivers/staging/most/aim-network/networking.c

index a3009fdfa27829dbcd2b4680ab90ad28ac3914d7..11f03d3cd56587a256a0a8d6ac4adb73db0d87ea 100644 (file)
@@ -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;