netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: Allocate enough space for the FDB sub-namespaces
@ 2018-10-21 11:05 Or Gerlitz
  2018-10-22  6:19 ` Or Gerlitz
  2018-10-23  2:46 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Or Gerlitz @ 2018-10-21 11:05 UTC (permalink / raw)
  To: David S. Miller; +Cc: Saeed Mahameed, netdev, Dan Carpenter

From: Dan Carpenter <dan.carpenter@oracle.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@oracle.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.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

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

* Re: [PATCH] net/mlx5: Allocate enough space for the FDB sub-namespaces
  2018-10-21 11:05 [PATCH] net/mlx5: Allocate enough space for the FDB sub-namespaces Or Gerlitz
@ 2018-10-22  6:19 ` Or Gerlitz
  2018-10-23  2:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Or Gerlitz @ 2018-10-22  6:19 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: David Miller, Saeed Mahameed, Linux Netdev List, Dan Carpenter

On Sun, Oct 21, 2018 at 2:47 PM Or Gerlitz <ogerlitz@mellanox.com> wrote:
>
> From: Dan Carpenter <dan.carpenter@oracle.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@oracle.com>
> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>

Dave, I forgot to mark it as net-next, so here I am saying that..


> ---
>  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
>

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

* Re: [PATCH] net/mlx5: Allocate enough space for the FDB sub-namespaces
  2018-10-21 11:05 [PATCH] net/mlx5: Allocate enough space for the FDB sub-namespaces Or Gerlitz
  2018-10-22  6:19 ` Or Gerlitz
@ 2018-10-23  2:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-10-23  2:46 UTC (permalink / raw)
  To: ogerlitz; +Cc: saeedm, netdev, dan.carpenter

From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Sun, 21 Oct 2018 14:05:49 +0300

> From: Dan Carpenter <dan.carpenter@oracle.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@oracle.com>
> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>

Applied to net-next.

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

end of thread, other threads:[~2018-10-23 11:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-21 11:05 [PATCH] net/mlx5: Allocate enough space for the FDB sub-namespaces Or Gerlitz
2018-10-22  6:19 ` Or Gerlitz
2018-10-23  2:46 ` David Miller

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).