From: Ira Weiny Date: Thu, 25 Jun 2015 16:04:49 +0000 (-0400) Subject: IB/mad: Fix compare between big endian and cpu endian X-Git-Tag: v4.2-rc3~26^2~22 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cd4cd565e049c6e734a12754d91d1142c25f6a64;p=karo-tx-linux.git IB/mad: Fix compare between big endian and cpu endian The define OPA_LID_PERMISSIVE is big endian and was compared to the cpu endian variable opa_drslid. Problem caught by 0-day build infrastructure. Fixes: 8e4349d13f33 (IB/mad: Add final OPA MAD processing) Signed-off-by: Ira Weiny Reviewed-by: Mike Marciniszyn Reviewed-by: John, Jubin Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index c82d751aede1..786fc51bf04b 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c @@ -795,7 +795,7 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv, goto out; } opa_drslid = be32_to_cpu(opa_smp->route.dr.dr_slid); - if (opa_drslid != OPA_LID_PERMISSIVE && + if (opa_drslid != be32_to_cpu(OPA_LID_PERMISSIVE) && opa_drslid & 0xffff0000) { ret = -EINVAL; dev_err(&device->dev, "OPA Invalid dr_slid 0x%x\n",