Skip to contentSkip to conversation

RDMA/mlx4: Initialize ib_spec on the stack

PATCH Applied Leon Romanovsky 2 participants 2 messages Apr 13, 2020 – Apr 15, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/mlx4: Initialize ib_spec on the stack

From: Alaa Hleihel <[email protected]>

Initialize ib_spec on the stack before using it, otherwise we will have garbage values that will break creating default rules with invalid parsing error.

Fixes a37a1a428431 ("IB/mlx4: Add mechanism to support flow steering over IB links")
---
 drivers/infiniband/hw/mlx4/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/mlx4/main.c +2 -1
index a66518a5c938..275722cec8c6 100644
@@ -1499,8 +1499,9 @@ static int __mlx4_ib_create_default_rules(
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(pdefault_rules->rules_create_list); i++) {
+		union ib_flow_spec ib_spec = {};
 		int ret;
-		union ib_flow_spec ib_spec;
+
 		switch (pdefault_rules->rules_create_list[i]) {
 		case 0:
 			/* no rule */
Signature · 1 line
2.25.2
#1 lore raw
Quoted 6 lines · Leon Romanovsky

From: Alaa Hleihel <[email protected]>

Initialize ib_spec on the stack before using it, otherwise we will have garbage values that will break creating default rules with invalid parsing error.

Quoted 7 lines
Fixes a37a1a428431 ("IB/mlx4: Add mechanism to support flow steering over IB links")
---
 drivers/infiniband/hw/mlx4/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied to for-rc, thanks

Jason