> -----Original Message-----
> From: Stephen Hemminger <step...@networkplumber.org>
> Sent: Wednesday, August 3, 2022 23:16
> To: Guo, Junfeng <junfeng....@intel.com>
> Cc: Zhang, Qi Z <qi.z.zh...@intel.com>; Wu, Jingjing
> <jingjing...@intel.com>; Xing, Beilei <beilei.x...@intel.com>;
> dev@dpdk.org; Li, Xiaoyun <xiaoyun...@intel.com>
> Subject: Re: [PATCH 04/13] net/idpf: add queue operations
> 
> On Wed,  3 Aug 2022 19:30:55 +0800
> Junfeng Guo <junfeng....@intel.com> wrote:
> 
> > +static void
> > +idpf_tx_queue_release(void *txq)
> > +{
> > +   struct idpf_tx_queue *q = (struct idpf_tx_queue *)txq;
> > +
> > +   if (!q)
> > +           return;
> > +
> > +   if (q->complq)
> > +           rte_free(q->complq);
> 
> null pointer check before calling rte_free is unnecessary.
> rte_free(NULL) works.

Thanks for your review! Will refine this in the patchset of upcoming version.

> 
> There is even a script used to scan DPDK to fix this.
>    devtools/cocci/nullfree.cocci

Reply via email to