[ovs-dev] [PATCH V2] netdev-dpdk: fix ingress_policer leak on error path
Stokes, Ian
ian.stokes at intel.com
Thu Jan 11 11:18:19 UTC 2018
> From: zhangliping <zhangliping02 at baidu.com>
>
> We forgot to free the policer if rte_meter_srtcm_config failed, so memory
> leak would happen.
>
> Fixes: 9509913aa722 ("netdev-dpdk.c: Add ingress-policing functionality.")
> Signed-off-by: zhangliping <zhangliping02 at baidu.com>
> ---
> V2: Improve the commit log, and add the Fixes tag, suggested by Ian
> Stokes.
>
> lib/netdev-dpdk.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index
> 364f545c4..770d6aca9 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -2251,6 +2251,7 @@ netdev_dpdk_policer_construct(uint32_t rate,
> uint32_t burst)
> &policer->app_srtcm_params);
> if (err) {
> VLOG_ERR("Could not create rte meter for ingress policer");
> + free(policer);
> return NULL;
> }
>
Thanks Zhang,
I've applied this to the DPDK_MERGE branch with a minor edit to the commit message.
This patch can be backported to OVS 2.8, 2.7 and 2.6 as well, I can handle this.
Thanks
Ian
> --
> 2.13.4
>
More information about the dev
mailing list