Skip to contentSkip to conversation

IB/mad: Fix 0-day build

PATCH In review [email protected] 4 participants 4 messages Jun 25, 2015 – Jul 8, 2015 2 messages not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 IB/mad: Fix 0-day build

From: Ira Weiny <[email protected]>

The define OPA_LID_PERMISSIVE is big endian and was compared to cpu value opa_drslid.

0-day build caught this while building with the OPA (hfi1) driver which was recently sent to the list.

Fixes 8e4349d13f33 (IB/mad: Add final OPA MAD processing)

---
Changes from V2
Really update the commit message

 drivers/infiniband/core/mad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/mad.c +1 -1
index a4b1466c1bf6..9c90a729db62 100644
@@ -794,7 +794,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",
Signature · 6 lines
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1435248289-16477-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 9 lines · On 06/25/2015 09:04 AM, [email protected] wrote:

From: Ira Weiny <[email protected]>

The define OPA_LID_PERMISSIVE is big endian and was compared to cpu value opa_drslid.

0-day build caught this while building with the OPA (hfi1) driver which was recently sent to the list.

Fixes 8e4349d13f33 (IB/mad: Add final OPA MAD processing)

Hello Ira,

For future patches please make sure that the subject of the patch describes what has been fixed instead of referring to the tool that detected the issue.

Thanks,

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Re: COMMERCIAL: Re: [PATCH V3] IB/mad: Fix 0-day build

Quoted 6 lines · Bart Van Assche
Quoted 5 lines · On 06/25/2015 09:04 AM, [email protected] wrote:

From: Ira Weiny <[email protected]>

The define OPA_LID_PERMISSIVE is big endian and was compared to cpu value opa_drslid.

Quoted 9 lines
Quoted 4 lines

0-day build caught this while building with the OPA (hfi1) driver which was recently sent to the list.

Fixes 8e4349d13f33 (IB/mad: Add final OPA MAD processing)

Hello Ira,

For future patches please make sure that the subject of the patch describes what has been fixed instead of referring to the tool that detected the issue.

Also, Ira, make sure to avoid two patches with the same name in the same series, such as

f28990b IB/mad: Add partial Intel OPA MAD support
548ead1 IB/mad: Add partial Intel OPA MAD support

Maybe you should ask Sean to go over patch titles and change-logs till you'll be up to speed on how this should be done, he has lots of kernel experience

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
In reply to a message not in the archive
Quoted 10 lines · On 06/25/2015 12:04 PM, [email protected] wrote:

From: Ira Weiny <[email protected]>

The define OPA_LID_PERMISSIVE is big endian and was compared to cpu value opa_drslid.

0-day build caught this while building with the OPA (hfi1) driver which was recently sent to the list.

Fixes 8e4349d13f33 (IB/mad: Add final OPA MAD processing)
Quoted 7 lines

---
Changes from V2
Really update the commit message

I made some changes to the commit message, but patch was taken as is.

Quoted 18 lines
 drivers/infiniband/core/mad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/mad.c +1 -1
index a4b1466c1bf6..9c90a729db62 100644
@@ -794,7 +794,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",
Signature · 2 lines
Doug Ledford <[email protected]>
              GPG KeyID: 0E572FDD