[PATCH v2] eventdev/eth_rx: fix memory leak when token parsing finished

Weiguo Li liwg06 at foxmail.com
Thu Feb 3 04:38:07 CET 2022


Hi Ganapati,

Thanks for your reminding.

I'm a bit confused by "eth_dev_id validate" you metiond below.
I'll post a new patch for your review if this make clear.

Thanks,
-Weiguo

> ------------------ Original ------------------
> From: "Kundapura, Ganapati" <ganapati.kundapura at intel.com>;
> Date: Thu, Feb 3, 2022 00:47 AM
> To: "Weiguo Li"<liwg06 at foxmail.com>;"Jayatheerthan, Jay"<jay.jayatheerthan at intel.com>;
> Cc: "Naga Harish K, S V"<s.v.naga.harish.k at intel.com>;"dev at dpdk.org"<dev at dpdk.org>;
> Subject: RE: [PATCH v2] eventdev/eth_rx: fix memory leak when token parsing finished
> 
> Hi Weiguo,
>    Also noticed that usage of macros like RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET and 
> RTE_ETH_VALID_PORTID_OR_ERR_RET to validate rx_adapter_id and eth_dev_id returns error
> bypassing the freeing of memory get from strdup() in error case.
>
> Thanks,
> Ganapati
> > > >  	token = strtok(l_params, ",");
> > Validate token
> 
> > > >  	/* Get device ID from parameter string */
> > > >  	eth_dev_id = strtoul(token, NULL, 10);
> > > >  	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, -EINVAL);
> > Use RTE_ETH_VALID_PORTID_OR_ERR_RET to validate eth_dev_id

I looked up the macro defines:
RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET -- use rte_event_pmd_is_valid_dev()
RTE_ETH_VALID_PORTID_OR_ERR_RET     -- use rte_eth_dev_is_valid_port() 

If you mean the validate of "eth_dev_id" here be replaced by rte_eth_dev_is_valid_port() ?
or both rte_event_pmd_is_valid_dev() and rte_eth_dev_is_valid_port() used 
to do the validation?
	
	


More information about the dev mailing list