summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlaa Hleihel <alaa@mellanox.com>2020-04-13 16:22:35 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-06 09:13:30 +0300
commit4611d2a4acbc4c50554bc03fe57e1d08ef61091a (patch)
tree08ae1503fb8b73f03261983383390b044b51842d /drivers
parent9bdec3820fa3faa1bb0e786fc0f359d9c6efd233 (diff)
downloadlinux-4611d2a4acbc4c50554bc03fe57e1d08ef61091a.tar.xz
RDMA/mlx4: Initialize ib_spec on the stack
commit c08cfb2d8d78bfe81b37cc6ba84f0875bddd0d5c upstream. 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") Link: https://lore.kernel.org/r/20200413132235.930642-1-leon@kernel.org Signed-off-by: Alaa Hleihel <alaa@mellanox.com> Reviewed-by: Maor Gottlieb <maorg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/mlx4/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index a19d3ad14dc3..eac4ade45611 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -1606,8 +1606,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 */