[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220919142119.5b473800@kernel.org>
Date: Mon, 19 Sep 2022 14:21:19 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Jianglei Nie <niejianglei2021@....com>
Cc: aelior@...vell.com, skalluru@...vell.com, manishc@...vell.com,
davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] bnx2x: fix potential memory leak in bnx2x_tpa_stop()
On Wed, 7 Sep 2022 14:51:28 +0800 Jianglei Nie wrote:
> bnx2x_tpa_stop() allocates a memory chunk from new_data with
> bnx2x_frag_alloc(). The new_data should be freed when gets some error.
> But when "pad + len > fp->rx_buf_size" is true, bnx2x_tpa_stop() returns
> without releasing the new_data, which will lead to a memory leak.
>
> We should free the new_data with bnx2x_frag_free() when "pad + len >
> fp->rx_buf_size" is true.
Please add a Fixes tag and repost.
Powered by blists - more mailing lists