> -----Original Message-----
> From: Jerin Jacob [mailto:[email protected]]
> Sent: Wednesday, September 30, 2020 2:15 AM
> To: wangyunjian <[email protected]>
> Cc: dpdk-dev <[email protected]>; Jerin Jacob <[email protected]>; Nithin
> Dabilpuram <[email protected]>; Kiran Kumar K
> <[email protected]>; Lilijun (Jerry) <[email protected]>;
> xudingke <[email protected]>; dpdk stable <[email protected]>
> Subject: Re: [dpdk-dev] [PATCH] net/octeontx2: remove logically dead code
> 
> On Wed, Aug 26, 2020 at 4:48 PM wangyunjian <[email protected]>
> wrote:
> >
> > From: Yunjian Wang <[email protected]>
> >
> > Coverity issue: 357719
> > Fixes: da138cd47e06 ("net/octeontx2: handle port reconfigure")
> > Cc: [email protected]
> >
> > Signed-off-by: Yunjian Wang <[email protected]>
> > ---
> >  drivers/net/octeontx2/otx2_ethdev.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/net/octeontx2/otx2_ethdev.c
> > b/drivers/net/octeontx2/otx2_ethdev.c
> > index 33b72bd4d..3f9399cc8 100644
> > --- a/drivers/net/octeontx2/otx2_ethdev.c
> > +++ b/drivers/net/octeontx2/otx2_ethdev.c
> > @@ -1355,8 +1355,6 @@ nix_store_queue_cfg_and_then_release(struct
> > rte_eth_dev *eth_dev)
> >  fail:
> 
> See below
> 
> >         if (tx_qconf)
> >                 free(tx_qconf);
> > -       if (rx_qconf)
> > -               free(rx_qconf);
> 
> I think, it is clean and maintainable code have free() if rx_qconf as if we 
> add
> some another exit error case in the future, we simply forget to add this check
> and it will fail. So I prefer to keep as-is for the sake of maintainability 
> as there is
> no harm.

Hi, Jerin

Thanks for your explanation.
According to Stephen's suggestion, is it need to remove unnecessary NULL check?

Thanks,
Yunjian

> 
> 
> >
> >         return -ENOMEM;
> >  }
> > --
> > 2.23.0
> >
> >

Reply via email to