From: Saeed Mahameed <saeed@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>, Paul Blakey <paulb@nvidia.com>
Cc: Leon Romanovsky <leon@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH net-next] net/mlx5: check for allocation failure in mlx5_ft_pool_init()
Date: Thu, 03 Jun 2021 12:17:39 -0700 [thread overview]
Message-ID: <1b6a19b9b0d0e5977b7b8671bbd4f9d05ca3a62f.camel@kernel.org> (raw)
In-Reply-To: <YLjNfHuTQ817oUtX@mwanda>
On Thu, 2021-06-03 at 15:39 +0300, Dan Carpenter wrote:
> Add a check for if the kzalloc() fails.
>
> Fixes: 4a98544d1827 ("net/mlx5: Move chains ft pool to be used by all
> firmware steering")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c
> b/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c
> index 526fbb669142..c14590acc772 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c
> @@ -27,6 +27,8 @@ int mlx5_ft_pool_init(struct mlx5_core_dev *dev)
> int i;
>
> ft_pool = kzalloc(sizeof(*ft_pool), GFP_KERNEL);
> + if (!ft_pool)
> + return -ENOMEM;
>
> for (i = ARRAY_SIZE(FT_POOLS) - 1; i >= 0; i--)
> ft_pool->ft_left[i] = FT_SIZE / FT_POOLS[i];
applied to net-next-mlx5,
thanks
prev parent reply other threads:[~2021-06-03 19:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-03 12:39 [PATCH net-next] net/mlx5: check for allocation failure in mlx5_ft_pool_init() Dan Carpenter
2021-06-03 13:12 ` Leon Romanovsky
2021-06-03 15:46 ` Dan Carpenter
2021-06-03 19:17 ` Saeed Mahameed [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1b6a19b9b0d0e5977b7b8671bbd4f9d05ca3a62f.camel@kernel.org \
--to=saeed@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=paulb@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).