[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1540119949-1748-1-git-send-email-ogerlitz@mellanox.com>
Date: Sun, 21 Oct 2018 14:05:49 +0300
From: Or Gerlitz <ogerlitz@...lanox.com>
To: "David S. Miller" <davem@...emloft.net>
Cc: Saeed Mahameed <saeedm@...lanox.com>, netdev@...r.kernel.org,
Dan Carpenter <dan.carpenter@...cle.com>
Subject: [PATCH] net/mlx5: Allocate enough space for the FDB sub-namespaces
From: Dan Carpenter <dan.carpenter@...cle.com>
FDB_MAX_CHAIN is three. We wanted to allocate enough memory to hold four
structs but there are missing parentheses so we only allocate enough
memory for three structs and the first byte of the fourth one.
Fixes: 328edb499f99 ("net/mlx5: Split FDB fast path prio to multiple namespaces")
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
Reviewed-by: Or Gerlitz <ogerlitz@...lanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index 67ba4c9..9d73eb9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -2470,7 +2470,7 @@ static int init_fdb_root_ns(struct mlx5_flow_steering *steering)
return -ENOMEM;
steering->fdb_sub_ns = kzalloc(sizeof(steering->fdb_sub_ns) *
- FDB_MAX_CHAIN + 1, GFP_KERNEL);
+ (FDB_MAX_CHAIN + 1), GFP_KERNEL);
if (!steering->fdb_sub_ns)
return -ENOMEM;
--
2.3.7
Powered by blists - more mailing lists