summaryrefslogtreecommitdiffstats
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
authorScott Feldman <sfeldma@gmail.com>2015-06-11 11:20:42 -0700
committerDavid S. Miller <davem@davemloft.net>2015-06-23 06:57:17 -0700
commite9fdaec0e0d40f548c2b79e147c7ffd2809d2a64 (patch)
tree0f64fa084a34b501ec84856d8d71f440ba519eba /net/switchdev/switchdev.c
parent06baa3d0fb8491b21d579d3220569730c01efacc (diff)
downloadlinux-e9fdaec0e0d40f548c2b79e147c7ffd2809d2a64.tar.bz2
switchdev: change BUG_ON to WARN for attr set failure case
This particular BUG_ON condition was checking for attr set err in the COMMIT phase, which isn't expected (it's a driver bug if PREPARE phase is OK but COMMIT fails). But BUG_ON() is too strong for this case, so change to WARN(). BUG_ON() would be warranted if the system was corrupted beyond repair, but this is not the case here. Signed-off-by: Scott Feldman <sfeldma@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/switchdev/switchdev.c')
-rw-r--r--net/switchdev/switchdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 3e4b35a0c8cb..f01d34075749 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -184,7 +184,8 @@ int switchdev_port_attr_set(struct net_device *dev, struct switchdev_attr *attr)
attr->trans = SWITCHDEV_TRANS_COMMIT;
err = __switchdev_port_attr_set(dev, attr);
- BUG_ON(err);
+ WARN(err, "%s: Commit of attribute (id=%d) failed.\n",
+ dev->name, attr->id);
return err;
}