btrfs: fix race between quota disable and quota assign ioctls
[platform/kernel/linux-rpi.git] / net / dsa / switch.c
index 1c797ec..fb69f2f 100644 (file)
@@ -168,7 +168,7 @@ static int dsa_switch_bridge_leave(struct dsa_switch *ds,
                if (extack._msg)
                        dev_err(ds->dev, "port %d: %s\n", info->port,
                                extack._msg);
-               if (err && err != EOPNOTSUPP)
+               if (err && err != -EOPNOTSUPP)
                        return err;
        }
 
@@ -264,7 +264,7 @@ static int dsa_switch_do_mdb_del(struct dsa_switch *ds, int port,
 
        err = ds->ops->port_mdb_del(ds, port, mdb);
        if (err) {
-               refcount_inc(&a->refcount);
+               refcount_set(&a->refcount, 1);
                return err;
        }
 
@@ -329,7 +329,7 @@ static int dsa_switch_do_fdb_del(struct dsa_switch *ds, int port,
 
        err = ds->ops->port_fdb_del(ds, port, addr, vid);
        if (err) {
-               refcount_inc(&a->refcount);
+               refcount_set(&a->refcount, 1);
                return err;
        }
 
@@ -644,7 +644,7 @@ static int
 dsa_switch_mrp_add_ring_role(struct dsa_switch *ds,
                             struct dsa_notifier_mrp_ring_role_info *info)
 {
-       if (!ds->ops->port_mrp_add)
+       if (!ds->ops->port_mrp_add_ring_role)
                return -EOPNOTSUPP;
 
        if (ds->index == info->sw_index)
@@ -658,7 +658,7 @@ static int
 dsa_switch_mrp_del_ring_role(struct dsa_switch *ds,
                             struct dsa_notifier_mrp_ring_role_info *info)
 {
-       if (!ds->ops->port_mrp_del)
+       if (!ds->ops->port_mrp_del_ring_role)
                return -EOPNOTSUPP;
 
        if (ds->index == info->sw_index)