[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y0+3rd/tmB289uPX@unreal>
Date: Wed, 19 Oct 2022 11:39:09 +0300
From: Leon Romanovsky <leon@...nel.org>
To: shaozhengchao <shaozhengchao@...wei.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, keescook@...omium.org,
gustavoars@...nel.org, gregkh@...uxfoundation.org, ast@...nel.org,
peter.chen@...nel.org, bin.chen@...igine.com, luobin9@...wei.com,
weiyongjun1@...wei.com, yuehaibing@...wei.com
Subject: Re: [PATCH net 3/4] net: hinic: fix the issue of CMDQ memory leaks
On Wed, Oct 19, 2022 at 03:41:06PM +0800, shaozhengchao wrote:
>
>
> On 2022/10/19 15:20, Leon Romanovsky wrote:
> > On Wed, Oct 19, 2022 at 10:42:19AM +0800, Zhengchao Shao wrote:
> > > When hinic_set_cmdq_depth() fails in hinic_init_cmdqs(), the cmdq memory is
> > > not released correctly. Fix it.
> > >
> > > Fixes: 72ef908bb3ff ("hinic: add three net_device_ops of vf")
> > > Signed-off-by: Zhengchao Shao <shaozhengchao@...wei.com>
> > > ---
> > > drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c | 5 +++++
> > > 1 file changed, 5 insertions(+)
> >
> > <...>
> >
> > > + cmdq_type = HINIC_CMDQ_SYNC;
> > > + for (; cmdq_type < HINIC_MAX_CMDQ_TYPES; cmdq_type++)
> >
> > Why do you have this "for loops" in all places? There is only one cmdq_type.
> >
> > Thanks
> Hi Leon:
> Thank you for your review. Now, only the synchronous CMDQ is
> enabled for the current CMDQs. New type of CMDQ could be added later.
Single command type was added in 2017, and five years later, new type wasn't added yet.
> So looping style is maintained on both the allocation and release paths.
>
> Zhengchao Shao
Powered by blists - more mailing lists