[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ea4b318c-4c35-9074-589e-2336b9997384@huawei.com>
Date: Wed, 7 Dec 2022 08:53:17 +0800
From: shaozhengchao <shaozhengchao@...wei.com>
To: Jiri Pirko <jiri@...nulli.us>
CC: <netdev@...r.kernel.org>, <michael.jamet@...el.com>,
<mika.westerberg@...ux.intel.com>, <YehezkelShB@...il.com>,
<davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<pabeni@...hat.com>, <weiyongjun1@...wei.com>,
<yuehaibing@...wei.com>
Subject: Re: [PATCH net v2] net: thunderbolt: fix memory leak in tbnet_open()
On 2022/12/6 17:38, Jiri Pirko wrote:
> Tue, Dec 06, 2022 at 02:06:46AM CET, shaozhengchao@...wei.com wrote:
>> When tb_ring_alloc_rx() failed in tbnet_open(), it doesn't free ida.
>
> You should be imperative to the codebase in your patch descriptions.
>
Thank you for your advice. I will describe more detail later.
> The code fix looks okay.
>
>>
>> Fixes: 180b0689425c ("thunderbolt: Allow multiple DMA tunnels over a single XDomain connection")
>> Signed-off-by: Zhengchao Shao <shaozhengchao@...wei.com>
>> ---
>> v2: move release ida before free tx_ring
>> ---
>> drivers/net/thunderbolt.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/net/thunderbolt.c b/drivers/net/thunderbolt.c
>> index a52ee2bf5575..6312f67f260e 100644
>> --- a/drivers/net/thunderbolt.c
>> +++ b/drivers/net/thunderbolt.c
>> @@ -914,6 +914,7 @@ static int tbnet_open(struct net_device *dev)
>> eof_mask, tbnet_start_poll, net);
>> if (!ring) {
>> netdev_err(dev, "failed to allocate Rx ring\n");
>> + tb_xdomain_release_out_hopid(xd, hopid);
>> tb_ring_free(net->tx_ring.ring);
>> net->tx_ring.ring = NULL;
>> return -ENOMEM;
>> --
>> 2.34.1
>>
Powered by blists - more mailing lists