]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: dsa: uninitialized variable in dsa_slave_netdevice_event()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 14 Oct 2022 15:08:39 +0000 (18:08 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 15 Oct 2022 10:15:27 +0000 (11:15 +0100)
Return zero if both dsa_slave_dev_check() and netdev_uses_dsa() are false.

Fixes: 6fd212f7c006 ("net: dsa: allow masters to join a LAG")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/slave.c

index 1a59918d3b3051e5656742b990f3621cd6ce0428..a9fde48cffd437bc8501512f1fb12521e61d0928 100644 (file)
@@ -3145,7 +3145,7 @@ static int dsa_slave_netdevice_event(struct notifier_block *nb,
        case NETDEV_CHANGELOWERSTATE: {
                struct netdev_notifier_changelowerstate_info *info = ptr;
                struct dsa_port *dp;
-               int err;
+               int err = 0;
 
                if (dsa_slave_dev_check(dev)) {
                        dp = dsa_slave_to_port(dev);