]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: dsa: fix switch tree list
authorVivien Didelot <vivien.didelot@gmail.com>
Fri, 18 Oct 2019 21:02:46 +0000 (17:02 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 26 Nov 2019 12:16:00 +0000 (13:16 +0100)
BugLink: https://bugs.launchpad.net/bugs/1853208
[ Upstream commit 50c7d2ba9de20f60a2d527ad6928209ef67e4cdd ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/dsa/dsa2.c

index fc665b985e2827b99fbed48dbb633ad055f27117..b82457378aa76438bde970fe13b17a7e74d3264b 100644 (file)
@@ -49,7 +49,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);