diff mbox

[librdmacm,TRIVIAL] rsocket.c: In rsetsockopt, for RDMA_ROUTE option, use malloc rather than calloc

Message ID 53A1A28E.7000408@dev.mellanox.co.il (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Hal Rosenstock June 18, 2014, 2:30 p.m. UTC
No need to clear allocated memory as immediately followed by
memcpy which covers the allocated memory.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Hefty, Sean June 18, 2014, 5:07 p.m. UTC | #1
thanks - applied
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/rsocket.c b/src/rsocket.c
index 3a9ff7d..a3c5385 100644
--- a/src/rsocket.c
+++ b/src/rsocket.c
@@ -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;