]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: dsa: remove duplicate assignment in dsa_slave_add_cls_matchall_mirred
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 4 May 2020 19:58:56 +0000 (22:58 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 May 2020 00:30:35 +0000 (17:30 -0700)
This was caused by a poor merge conflict resolution on my side. The
"act = &cls->rule->action.entries[0];" assignment was already present in
the code prior to the patch mentioned below.

Fixes: e13c2075280e ("net: dsa: refactor matchall mirred action to separate function")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/slave.c

index d1068803cd1116781e53052a6defe8b9ae9b9fe1..62f4ee3da172a0489a183e3e9abd6f1439ad1481 100644 (file)
@@ -856,20 +856,18 @@ dsa_slave_add_cls_matchall_mirred(struct net_device *dev,
        struct dsa_port *to_dp;
        int err;
 
-       act = &cls->rule->action.entries[0];
-
        if (!ds->ops->port_mirror_add)
                return -EOPNOTSUPP;
 
-       if (!act->dev)
-               return -EINVAL;
-
        if (!flow_action_basic_hw_stats_check(&cls->rule->action,
                                              cls->common.extack))
                return -EOPNOTSUPP;
 
        act = &cls->rule->action.entries[0];
 
+       if (!act->dev)
+               return -EINVAL;
+
        if (!dsa_slave_dev_check(act->dev))
                return -EOPNOTSUPP;