[dpdk-dev] [PATCH v6] af_packet: Fix some klocwork errors

2015-03-11 Thread Ouyang, Changchun
> -Original Message- > From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com] > Sent: Tuesday, March 10, 2015 6:20 PM > To: Ouyang, Changchun > Cc: dev at dpdk.org; Wodkowski, PawelX > Subject: Re: [dpdk-dev] [PATCH v6] af_packet: Fix some klocwork errors >

[dpdk-dev] [PATCH v6] af_packet: Fix some klocwork errors

2015-03-10 Thread Ouyang Changchun
Fix possible memory leak issue: free kvlist before return; Fix possible resource lost issue: close qssockfd before return; Signed-off-by: Changchun Ouyang --- Change in v6: - Refine exit point; Change in v5: - Initialize qsockfd with -1; Change in v4: - Check sockfd in

[dpdk-dev] [PATCH v6] af_packet: Fix some klocwork errors

2015-03-10 Thread Thomas Monjalon
2015-03-10 08:49, Ouyang, Changchun: > From: Wodkowski, PawelX > > > + if (kvlist != NULL) > > > > No need for if(). This part was fine previous patch. > > > > If kvlist is NULL, no reason to call rte_kvargs_free to free it. > So, adding this test is better. No, we don't need to double check.

[dpdk-dev] [PATCH v6] af_packet: Fix some klocwork errors

2015-03-10 Thread Pawel Wodkowski
On 2015-03-10 09:49, Ouyang, Changchun wrote: > > >> -Original Message- >> From: Wodkowski, PawelX >> Sent: Tuesday, March 10, 2015 4:37 PM >> To: Ouyang, Changchun; dev at dpdk.org >> Cc: linville at tuxdriver.com; nhorman at tuxdriver.com >> Subject: Re: [PATCH v6] af_packet: Fix some

[dpdk-dev] [PATCH v6] af_packet: Fix some klocwork errors

2015-03-10 Thread Pawel Wodkowski
> - > - return 0; > +exit: > + if (kvlist != NULL) No need for if(). This part was fine previous patch. > + rte_kvargs_free(kvlist); > + return ret; > } > > static struct rte_driver pmd_af_packet_drv = { > -- Pawel

[dpdk-dev] [PATCH v6] af_packet: Fix some klocwork errors

2015-03-10 Thread Ouyang, Changchun
> -Original Message- > From: Wodkowski, PawelX > Sent: Tuesday, March 10, 2015 4:37 PM > To: Ouyang, Changchun; dev at dpdk.org > Cc: linville at tuxdriver.com; nhorman at tuxdriver.com > Subject: Re: [PATCH v6] af_packet: Fix some klocwork errors > > > - > > - return 0; > > +exit: >