diff mbox

[libibverbs,9/9] ibv_cmd_destroy_flow(): initialize comp_mask explicitly

Message ID ae9ea939d3947e169f5fe7d488fb834d904503fc.1412163687.git.ydroneaud@opteya.com (mailing list archive)
State Rejected
Headers show

Commit Message

Yann Droneaud Oct. 1, 2014, 11:49 a.m. UTC
There's no need to clear the whole struct ibv_destroy_flow
with memset(): only comp_mask field is not explicitly
initialized in the function.

This patch removes call to memset() and initialize
comp_mask to 0.

Link: http://marc.info/?i=cover.1412163687.git.ydroneaud@opteya.com
Fixes: 389de6a6ef4e ('Add receive flow steering support')
Cc: Hadar Hen Zion <hadarh@mellanox.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>
Cc: Matan Barak <matanb@mellanox.com>
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
---
 src/cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/src/cmd.c b/src/cmd.c
index 2f039f6852bb..d849e6dac214 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -1384,8 +1384,8 @@  int ibv_cmd_destroy_flow(struct ibv_flow *flow_id)
 	struct ibv_destroy_flow cmd;
 	int ret = 0;
 
-	memset(&cmd, 0, sizeof(cmd));
 	IBV_INIT_CMD_EX(&cmd, sizeof(cmd), DESTROY_FLOW);
+	cmd.comp_mask = 0;
 	cmd.flow_handle = flow_id->handle;
 
 	if (write(flow_id->context->cmd_fd, &cmd, sizeof(cmd)) != sizeof(cmd))