DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pawel Wodkowski <pawelx.wodkowski@intel.com>
To: "Ouyang, Changchun" <changchun.ouyang@intel.com>,
	 "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v6] af_packet: Fix some klocwork errors
Date: Tue, 10 Mar 2015 09:59:40 +0100	[thread overview]
Message-ID: <54FEB27C.3040502@intel.com> (raw)
In-Reply-To: <F52918179C57134FAEC9EA62FA2F962511A2FF15@shsmsx102.ccr.corp.intel.com>

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@dpdk.org
>> Cc: linville@tuxdriver.com; nhorman@tuxdriver.com
>> Subject: Re: [PATCH v6] af_packet: Fix some klocwork errors
>>
>>> -
>>> -	return 0;
>>> +exit:
>>> +	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.

For programmer convenience and reduce code bloat/obfuscation the same 
test is in rte_kvargs_free() (and every other free-like function). If 
there is no particular reason for that (ex performance which is not in 
this path) checking pointer for NULL value should be avoided before 
freeing it.

>
>>> +		rte_kvargs_free(kvlist);
>>> +	return ret;
>>>    }
>>>
>>>    static struct rte_driver pmd_af_packet_drv = {
>>>
>>
>>
>> --
>> Pawel


-- 
Pawel

  reply	other threads:[~2015-03-10  9:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26  6:42 [dpdk-dev] [PATCH] " Ouyang Changchun
2015-02-26  8:44 ` Pawel Wodkowski
2015-02-27  0:49 ` [dpdk-dev] [PATCH v2] " Ouyang Changchun
2015-02-27 14:04   ` Neil Horman
2015-02-28  0:51     ` Ouyang, Changchun
2015-02-28  1:27   ` [dpdk-dev] [PATCH v3] " Ouyang Changchun
2015-03-09  3:49     ` [dpdk-dev] [PATCH v4] " Ouyang Changchun
2015-03-09  6:38       ` Qiu, Michael
2015-03-09  8:47         ` Ouyang, Changchun
2015-03-09  8:58       ` [dpdk-dev] [PATCH v5] " Ouyang Changchun
2015-03-09 19:25         ` John W. Linville
2015-03-10  3:29         ` [dpdk-dev] [PATCH v6] " Ouyang Changchun
2015-03-10  8:36           ` Pawel Wodkowski
2015-03-10  8:49             ` Ouyang, Changchun
2015-03-10  8:59               ` Pawel Wodkowski [this message]
2015-03-10 10:19               ` Thomas Monjalon
2015-03-11  1:18                 ` Ouyang, Changchun
2015-03-11  1:34           ` [dpdk-dev] [PATCH v7] " Ouyang Changchun
2015-03-12 10:43             ` Qiu, Michael
2015-03-12 13:38               ` Neil Horman
2015-03-12 17:09                 ` John W. Linville
2015-03-17 21:34                   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54FEB27C.3040502@intel.com \
    --to=pawelx.wodkowski@intel.com \
    --cc=changchun.ouyang@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).