net: dsa: fix switch tree list
authorVivien Didelot <vivien.didelot@gmail.com>
Fri, 18 Oct 2019 21:02:46 +0000 (17:02 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sat, 19 Oct 2019 19:19:41 +0000 (12:19 -0700)
If there are multiple switch trees on the device, only the last one
will be listed, because the arguments of list_add_tail are swapped.

Fixes: 83c0afaec7b7 ("net: dsa: Add new binding implementation")
Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa2.c

index 73002022c9d820df95b9df1841ce3724c4d41070..716d265ba8ca95e88afeb3788b316a25fe331c38 100644 (file)
@@ -46,7 +46,7 @@ static struct dsa_switch_tree *dsa_tree_alloc(int index)
        dst->index = index;
 
        INIT_LIST_HEAD(&dst->list);
-       list_add_tail(&dsa_tree_list, &dst->list);
+       list_add_tail(&dst->list, &dsa_tree_list);
 
        kref_init(&dst->refcount);