net: dsa: fix switch tree list
Subsystems (3)
PATCH 1/1 net: dsa: fix switch tree list
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 <[email protected]>
--- net/dsa/dsa2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/dsa/dsa2.c +1 -1
@@ -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);
Signature · 1 line
2.23.0
Quoted 5 lines · Vivien Didelot
If there are multiple switch trees on the device, only the last one will be listed, because the arguments of
list_add_tailare swapped.Fixes 83c0afaec7b7 ("net: dsa: Add new binding implementation")Signed-off-by Vivien Didelot <[email protected]>
Reviewed-by Florian Fainelli <[email protected]>
Nice catch!
Signature · 1 line
Florian
David Miller
maintainerFrom: Vivien Didelot <[email protected]>
Date: Fri, 18 Oct 2019 17:02:46 -0400
Quoted 5 lines
If there are multiple switch trees on the device, only the last one will be listed, because the arguments of
list_add_tailare swapped.Fixes 83c0afaec7b7 ("net: dsa: Add new binding implementation")Signed-off-by Vivien Didelot <[email protected]>
Applied and queued up for-stable, thanks Vivien.