Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ee94014 authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller
Browse files

net: switchdev: don't abort unsupported operations



There is no need to abort attribute setting or object addition, if the
prepare phase returned operation not supported.

Thus, abort these two transactions only if the error is not -EOPNOTSUPP.

Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Acked-by: default avatarJiri Pirko <jiri@resnulli.us>
Acked-by: default avatarScott Feldman <sfeldma@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c590032f
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -171,8 +171,10 @@ int switchdev_port_attr_set(struct net_device *dev, struct switchdev_attr *attr)
		 * released.
		 */

		if (err != -EOPNOTSUPP) {
			attr->trans = SWITCHDEV_TRANS_ABORT;
			__switchdev_port_attr_set(dev, attr);
		}

		return err;
	}
@@ -249,8 +251,10 @@ int switchdev_port_obj_add(struct net_device *dev, struct switchdev_obj *obj)
		 * released.
		 */

		if (err != -EOPNOTSUPP) {
			obj->trans = SWITCHDEV_TRANS_ABORT;
			__switchdev_port_obj_add(dev, obj);
		}

		return err;
	}