linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH rdma-rc] RDMA/mlx4: Initialize ib_spec on the stack
@ 2020-04-13 13:22 Leon Romanovsky
  2020-04-15  0:41 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Leon Romanovsky @ 2020-04-13 13:22 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Alaa Hleihel, linux-rdma, Maor Gottlieb, Or Gerlitz,
	Roland Dreier, Yishai Hadas

From: Alaa Hleihel <alaa@mellanox.com>

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")
Signed-off-by: Alaa Hleihel <alaa@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx4/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index a66518a5c938..275722cec8c6 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -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 */
-- 
2.25.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH rdma-rc] RDMA/mlx4: Initialize ib_spec on the stack
  2020-04-13 13:22 [PATCH rdma-rc] RDMA/mlx4: Initialize ib_spec on the stack Leon Romanovsky
@ 2020-04-15  0:41 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2020-04-15  0:41 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, Alaa Hleihel, linux-rdma, Maor Gottlieb, Or Gerlitz,
	Roland Dreier, Yishai Hadas

On Mon, Apr 13, 2020 at 04:22:35PM +0300, Leon Romanovsky wrote:
> From: Alaa Hleihel <alaa@mellanox.com>
> 
> 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")
> Signed-off-by: Alaa Hleihel <alaa@mellanox.com>
> Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>  drivers/infiniband/hw/mlx4/main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied to for-rc, thanks

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-15  0:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-13 13:22 [PATCH rdma-rc] RDMA/mlx4: Initialize ib_spec on the stack Leon Romanovsky
2020-04-15  0:41 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).