Skip to contentSkip to conversation

infiniband-diags/ibportstate.c: Fix sizeof

PATCH Applied Hal Rosenstock 2 participants 2 messages Jun 8, 2011 – Jun 10, 2011 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 infiniband-diags/ibportstate.c: Fix sizeof

It shouldn't be sizeof the pointer but this doesn't affect execution since this parameter is not used by mad_dump_portstates

---

src/ibportstate.c +1 -1
index d2ee58b..1f0f42e 100644
@@ -126,7 +126,7 @@ static void show_port_info(ib_portid_t * dest, uint8_t * data, int portnum)
 	char buf[2048];
 	char val[64];
 
-	mad_dump_portstates(buf, sizeof buf, data, sizeof data);
+	mad_dump_portstates(buf, sizeof buf, data, sizeof *data);
 	mad_decode_field(data, IB_PORT_LID_F, val);
 	mad_dump_field(IB_PORT_LID_F, buf + strlen(buf),
 		       sizeof buf - strlen(buf), val);

--
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]

Applied
#2 lore raw
Quoted 5 lines · On Wed, 8 Jun 2011 05:57:55 -0700 Hal Rosenstock…

It shouldn't be sizeof the pointer but this doesn't affect execution since this parameter is not used by mad_dump_portstates

Thanks applied,
Ira

Quoted 14 lines

---

src/ibportstate.c +1 -1
index d2ee58b..1f0f42e 100644
@@ -126,7 +126,7 @@ static void show_port_info(ib_portid_t * dest, uint8_t * data, int portnum)
 	char buf[2048];
 	char val[64];
 
-	mad_dump_portstates(buf, sizeof buf, data, sizeof data);
+	mad_dump_portstates(buf, sizeof buf, data, sizeof *data);
 	mad_decode_field(data, IB_PORT_LID_F, val);
 	mad_dump_field(IB_PORT_LID_F, buf + strlen(buf),
 		       sizeof buf - strlen(buf), val);
Signature · 9 lines
Ira Weiny
Math Programmer/Computer Scientist
Lawrence Livermore National Lab
925-423-8008
[email protected]
--
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