Skip to contentSkip to conversation

rsocket.c: In rsetsockopt, for RDMA_ROUTE option, use malloc rather than calloc

PATCH In review Hal Rosenstock 2 participants 2 messages Jun 18, 2014 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rsocket.c: In rsetsockopt, for RDMA_ROUTE option, use malloc rather than calloc

No need to clear allocated memory as immediately followed by memcpy which covers the allocated memory.

---

src/rsocket.c +1 -1
index 3a9ff7d..a3c5385 100644
@@ -3473,7 +3473,7 @@ int rsetsockopt(int socket, int level, int optname,
 			ret = 0;
 			break;
 		case RDMA_ROUTE:
-			if ((rs->optval = calloc(optlen, 1))) {
+			if ((rs->optval = malloc(optlen))) {
 				memcpy(rs->optval, optval, optlen);
 				rs->optlen = optlen;
 				ret = 0;

--
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): 53A1A28E.7000408-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org