[v2] test-pmd: fix memory leaks when mtr policer actions update fails
Checks
Commit Message
From: Yunjian Wang <wangyunjian@huawei.com>
This patch fixes the Huawei internal coverity reported
resource leak issue.
Fixes: e63b50162aa3 ("app/testpmd: clean metering and policing commands")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
v2:
* Update commit log
---
app/test-pmd/cmdline_mtr.c | 1 +
1 file changed, 1 insertion(+)
Comments
25/05/2020 03:46, wangyunjian:
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> This patch fixes the Huawei internal coverity reported
> resource leak issue.
The problem is not seen in the community Coverity?
> Fixes: e63b50162aa3 ("app/testpmd: clean metering and policing commands")
> Cc: stable@dpdk.org
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
> v2:
> * Update commit log
Please, next time, use --in-reply-to to keep v1 and v2 in the same thread.
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Monday, May 25, 2020 2:51 PM
> To: wangyunjian <wangyunjian@huawei.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Lilijun (Jerry) <jerry.lilijun@huawei.com>;
> xudingke <xudingke@huawei.com>; wangyunjian <wangyunjian@huawei.com>;
> stable@dpdk.org; cristian.dumitrescu@intel.com
> Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2] test-pmd: fix memory leaks
> when mtr policer actions update fails
>
> 25/05/2020 03:46, wangyunjian:
> > From: Yunjian Wang <wangyunjian@huawei.com>
> >
> > This patch fixes the Huawei internal coverity reported resource leak
> > issue.
>
> The problem is not seen in the community Coverity?
I don't know much about that.
>
>
> > Fixes: e63b50162aa3 ("app/testpmd: clean metering and policing
> > commands")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> > ---
> > v2:
> > * Update commit log
>
> Please, next time, use --in-reply-to to keep v1 and v2 in the same thread.
OK, thanks.
>
26/05/2020 04:04, wangyunjian:
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > 25/05/2020 03:46, wangyunjian:
> > > From: Yunjian Wang <wangyunjian@huawei.com>
> > >
> > > This patch fixes the Huawei internal coverity reported resource leak
> > > issue.
> >
> > The problem is not seen in the community Coverity?
>
> I don't know much about that.
Please, could you register and check here?
https://scan.coverity.com/projects/dpdk-data-plane-development-kit
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Tuesday, May 26, 2020 3:14 PM
> To: wangyunjian <wangyunjian@huawei.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Lilijun (Jerry) <jerry.lilijun@huawei.com>;
> xudingke <xudingke@huawei.com>; cristian.dumitrescu@intel.com;
> john.mcnamara@intel.com
> Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2] test-pmd: fix memory leaks
> when mtr policer actions update fails
>
> 26/05/2020 04:04, wangyunjian:
> > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > > 25/05/2020 03:46, wangyunjian:
> > > > From: Yunjian Wang <wangyunjian@huawei.com>
> > > >
> > > > This patch fixes the Huawei internal coverity reported resource
> > > > leak issue.
> > >
> > > The problem is not seen in the community Coverity?
> >
> > I don't know much about that.
>
> Please, could you register and check here?
> https://scan.coverity.com/projects/dpdk-data-plane-development-kit
OK, I have registered, but I do not find this issue in it.
Thanks,
Yunjian
>
>
27/05/2020 04:10, wangyunjian:
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > 26/05/2020 04:04, wangyunjian:
> > > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > > > 25/05/2020 03:46, wangyunjian:
> > > > > From: Yunjian Wang <wangyunjian@huawei.com>
> > > > >
> > > > > This patch fixes the Huawei internal coverity reported resource
> > > > > leak issue.
> > > >
> > > > The problem is not seen in the community Coverity?
> > >
> > > I don't know much about that.
> >
> > Please, could you register and check here?
> > https://scan.coverity.com/projects/dpdk-data-plane-development-kit
>
> OK, I have registered, but I do not find this issue in it.
Thanks for having check.
On 5/25/2020 2:46 AM, wangyunjian wrote:
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> This patch fixes the Huawei internal coverity reported
> resource leak issue.
>
> Fixes: e63b50162aa3 ("app/testpmd: clean metering and policing commands")
> Cc: stable@dpdk.org
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Updating commit log as following:
"
app/testpmd: fix memory leaks on error path
This patch fixes the resource leak issue.
Fixes: e63b50162aa3 ("app/testpmd: clean metering and policing commands")
Cc: stable@dpdk.org
"
1) Updated patch title
2) Removed reference to internal coverity, since others can't access it, this
information doesn't add value
Applied to dpdk-next-net/master, thanks.
@@ -1262,6 +1262,7 @@ static void cmd_set_port_meter_policer_action_parsed(void *parsed_result,
ret = rte_mtr_policer_actions_update(port_id, mtr_id,
action_mask, actions, &error);
if (ret != 0) {
+ free(actions);
print_err_msg(&error);
return;
}