From mboxrd@z Thu Jan 1 00:00:00 1970 From: Or Gerlitz Subject: Re: [PATCH] net/mlx5: Allocate enough space for the FDB sub-namespaces Date: Mon, 22 Oct 2018 09:19:34 +0300 Message-ID: References: <1540119949-1748-1-git-send-email-ogerlitz@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: David Miller , Saeed Mahameed , Linux Netdev List , Dan Carpenter To: Or Gerlitz Return-path: Received: from mail-yb1-f195.google.com ([209.85.219.195]:39967 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727227AbeJVOgy (ORCPT ); Mon, 22 Oct 2018 10:36:54 -0400 Received: by mail-yb1-f195.google.com with SMTP id w7-v6so15694641ybm.7 for ; Sun, 21 Oct 2018 23:19:46 -0700 (PDT) In-Reply-To: <1540119949-1748-1-git-send-email-ogerlitz@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: On Sun, Oct 21, 2018 at 2:47 PM Or Gerlitz wrote: > > From: Dan Carpenter > > 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 > Reviewed-by: Or Gerlitz 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 >