aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath
diff options
context:
space:
mode:
authorIra Weiny <ira.weiny@intel.com>2015-06-25 09:52:50 -0400
committerDoug Ledford <dledford@redhat.com>2015-07-14 13:20:08 -0400
commit3b8ab700af0a5c5e59c833f8a88f94b97499f5e5 (patch)
tree61c9df6b14a335d7feb9853a629b63645095c180 /drivers/infiniband/hw/ipath
parentIB/mad: Fix compare between big endian and cpu endian (diff)
downloadlinux-dev-3b8ab700af0a5c5e59c833f8a88f94b97499f5e5.tar.xz
linux-dev-3b8ab700af0a5c5e59c833f8a88f94b97499f5e5.zip
IB/mad: Remove improper use of BUG_ON
We recently added BUG_ON's which were inappropriate for a condition which should never happen. Change these to be WARN_ON_ONCE as a debugging aid. Fixes: 4cd7c9479aff ('IB/mad: Add support for additional MAD info to/from drivers') Signed-off-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_mad.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_mad.c b/drivers/infiniband/hw/ipath/ipath_mad.c
index 948188e37f95..ad3a926ab3c5 100644
--- a/drivers/infiniband/hw/ipath/ipath_mad.c
+++ b/drivers/infiniband/hw/ipath/ipath_mad.c
@@ -1499,8 +1499,9 @@ int ipath_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
const struct ib_mad *in_mad = (const struct ib_mad *)in;
struct ib_mad *out_mad = (struct ib_mad *)out;
- BUG_ON(in_mad_size != sizeof(*in_mad) ||
- *out_mad_size != sizeof(*out_mad));
+ if (WARN_ON_ONCE(in_mad_size != sizeof(*in_mad) ||
+ *out_mad_size != sizeof(*out_mad)))
+ return IB_MAD_RESULT_FAILURE;
switch (in_mad->mad_hdr.mgmt_class) {
case IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE: