lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <adc71144-0026-6fed-224e-de619f76ba43@linux.intel.com>
Date:   Wed, 22 Nov 2017 14:57:12 +0800
From:   "Jin, Yao" <yao.jin@...ux.intel.com>
To:     Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
Cc:     acme@...nel.org, jolsa@...nel.org, peterz@...radead.org,
        mingo@...hat.com, alexander.shishkin@...ux.intel.com,
        Linux-kernel@...r.kernel.org, ak@...ux.intel.com,
        kan.liang@...el.com, yao.jin@...el.com
Subject: Re: [PATCH v1 3/9] perf util: Reconstruct rblist for supporting
 per-thread shadow stats



On 11/22/2017 2:31 PM, Ravi Bangoria wrote:
> 
> On 11/20/2017 08:13 PM, Jin Yao wrote:
>> @@ -76,6 +97,17 @@ static struct rb_node *saved_value_new(struct 
>> rblist *rblist __maybe_unused,
>>       return &nd->rb_node;
>>   }
>>
>> +static void saved_value_delete(struct rblist *rblist __maybe_unused,
>> +                   struct rb_node *rb_node)
>> +{
>> +    struct saved_value *v = container_of(rb_node,
>> +                         struct saved_value,
>> +                         rb_node);
>> +
>> +    if (v)
>> +        free(v);
>> +}
> 
> Do we really need if(v) ?
> 
> Thanks,
> Ravi
> 

Hi Ravi,

Looks it doesn't need if(v).

I put if(v) here is from my coding habits (checking pointer before free).

It's OK for me if you think the code should be removed.

Thanks
Jin Yao


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ