diff options
author | Ira Weiny <ira.weiny@intel.com> | 2015-06-25 13:52:50 (GMT) |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-07-14 17:20:08 (GMT) |
commit | 3b8ab700af0a5c5e59c833f8a88f94b97499f5e5 (patch) | |
tree | 61c9df6b14a335d7feb9853a629b63645095c180 /drivers/infiniband/hw/mthca | |
parent | cd4cd565e049c6e734a12754d91d1142c25f6a64 (diff) | |
download | linux-3b8ab700af0a5c5e59c833f8a88f94b97499f5e5.tar.xz |
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/mthca')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_mad.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_mad.c b/drivers/infiniband/hw/mthca/mthca_mad.c index 6b2418b..7c3f2fb 100644 --- a/drivers/infiniband/hw/mthca/mthca_mad.c +++ b/drivers/infiniband/hw/mthca/mthca_mad.c @@ -209,8 +209,9 @@ int mthca_process_mad(struct ib_device *ibdev, 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; /* Forward locally generated traps to the SM */ if (in_mad->mad_hdr.method == IB_MGMT_METHOD_TRAP && |