Skip to content

Commit

Permalink
switchdev: change BUG_ON to WARN for attr set failure case
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Scott Feldman authored and David S. Miller committed Jun 23, 2015
1 parent 06baa3d commit e9fdaec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/switchdev/switchdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e9fdaec

Please sign in to comment.