diff options
author | Steve Wise <swise@opengridcomputing.com> | 2017-11-03 00:11:03 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-11-13 23:01:25 +0300 |
commit | ba97b749979ef0ebb821e58ee8b16a84412922f6 (patch) | |
tree | 84f151ef1ef1931a5fc6512ea3fbce637770a4a9 /drivers/infiniband/hw/cxgb4/provider.c | |
parent | 063fb5bd1a01937094f40169a20e4aa5ca030db1 (diff) | |
download | linux-ba97b749979ef0ebb821e58ee8b16a84412922f6.tar.xz |
iw_cxgb4: remove BUG_ON() usage.
iw_cxgb4 has many BUG_ON()s that were left over from various enhancemnets
made over the years. Almost all of them should just be removed. Some,
however indicate a ULP usage error and can be handled w/o bringing down
the system.
If the condition cannot happen with correctly implemented cxgb4 sw/fw,
then remove the BUG_ON.
If the condition indicates a misbehaving ULP (like CQ overflows), add
proper recovery logic.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/cxgb4/provider.c')
-rw-r--r-- | drivers/infiniband/hw/cxgb4/provider.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c index fb99a05562a3..30206a57dbe7 100644 --- a/drivers/infiniband/hw/cxgb4/provider.c +++ b/drivers/infiniband/hw/cxgb4/provider.c @@ -310,8 +310,9 @@ static int c4iw_query_gid(struct ib_device *ibdev, u8 port, int index, pr_debug("ibdev %p, port %d, index %d, gid %p\n", ibdev, port, index, gid); + if (!port) + return -EINVAL; dev = to_c4iw_dev(ibdev); - BUG_ON(port == 0); memset(&(gid->raw[0]), 0, sizeof(gid->raw)); memcpy(&(gid->raw[0]), dev->rdev.lldi.ports[port-1]->dev_addr, 6); return 0; @@ -536,7 +537,6 @@ int c4iw_register_device(struct c4iw_dev *dev) int i; pr_debug("c4iw_dev %p\n", dev); - BUG_ON(!dev->rdev.lldi.ports[0]); strlcpy(dev->ibdev.name, "cxgb4_%d", IB_DEVICE_NAME_MAX); memset(&dev->ibdev.node_guid, 0, sizeof(dev->ibdev.node_guid)); memcpy(&dev->ibdev.node_guid, dev->rdev.lldi.ports[0]->dev_addr, 6); |