From: "Ramon Fried" <rfried.dev@gmail.com>
To: "Zhiqiang Hou" <Zhiqiang.Hou@nxp.com>, <joe.hershberger@ni.com>,
<priyanka.jain@nxp.com>, <u-boot@lists.denx.de>
Subject: Re: [PATCH] net: fm: Fix a memory leak issue
Date: Sat, 12 Jun 2021 21:14:07 +0300 [thread overview]
Message-ID: <CC1UE4M4SZWA.IV826LF0KXZ6@stdcall-pc> (raw)
In-Reply-To: <20210602063554.25281-1-Zhiqiang.Hou@nxp.com>
On Wed Jun 2, 2021 at 9:35 AM IDT, Zhiqiang Hou wrote:
> From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
>
> Fix a memory leak issue in the RX port initialization.
>
> Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
> ---
> drivers/net/fm/eth.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
> index 0e89e663f7..7c23ccc1f0 100644
> --- a/drivers/net/fm/eth.c
> +++ b/drivers/net/fm/eth.c
> @@ -288,8 +288,10 @@ static int fm_eth_rx_port_parameter_init(struct
> fm_eth *fm_eth)
>
> /* alloc Rx buffer from main memory */
> rx_buf_pool = malloc(MAX_RXBUF_LEN * RX_BD_RING_SIZE);
> - if (!rx_buf_pool)
> + if (!rx_buf_pool) {
> + free(rx_bd_ring_base);
> return -ENOMEM;
> + }
>
> memset(rx_buf_pool, 0, MAX_RXBUF_LEN * RX_BD_RING_SIZE);
> debug("%s: rx_buf_pool = %p\n", __func__, rx_buf_pool);
> --
> 2.17.1
Applied to u-boot-net/master, thanks!
Best regards,
Ramon Fried
prev parent reply other threads:[~2021-06-12 18:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-02 6:35 [PATCH] net: fm: Fix a memory leak issue Zhiqiang Hou
2021-06-12 18:14 ` Ramon Fried [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=CC1UE4M4SZWA.IV826LF0KXZ6@stdcall-pc \
--to=rfried.dev@gmail.com \
--cc=Zhiqiang.Hou@nxp.com \
--cc=joe.hershberger@ni.com \
--cc=priyanka.jain@nxp.com \
--cc=u-boot@lists.denx.de \
/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