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: <81a85e3c-2c29-a0d5-3ae6-3e72e1090447@linux.vnet.ibm.com>
Date:   Wed, 7 Jun 2017 16:04:57 +0530
From:   Anju T Sudhakar <anju@...ux.vnet.ibm.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     mpe@...erman.id.au, linux-kernel@...r.kernel.org,
        linuxppc-dev@...ts.ozlabs.org, ego@...ux.vnet.ibm.com,
        bsingharora@...il.com, anton@...ba.org, sukadev@...ux.vnet.ibm.com,
        mikey@...ling.org, stewart@...ux.vnet.ibm.com, dja@...ens.net,
        eranian@...gle.com, hemant@...ux.vnet.ibm.com,
        maddy@...ux.vnet.ibm.com
Subject: Re: [PATCH v9 07/10] powerpc/perf: PMU functions for Core IMC and
 hotplugging



On Wednesday 07 June 2017 11:14 AM, Anju T Sudhakar wrote:
> Hi Thomas,
>
> On Tuesday 06 June 2017 03:39 PM, Thomas Gleixner wrote:
>> On Mon, 5 Jun 2017, Anju T Sudhakar wrote:
>>> +static void cleanup_all_core_imc_memory(struct imc_pmu *pmu_ptr)
>>> +{
>>> +    struct imc_mem_info *ptr = pmu_ptr->mem_info;
>>> +
>>> +    if (!ptr)
>>> +        return;
>> That's pointless.
>
> No, it is not.  We may end up here from imc_mem_init() when the memory 
> allocation for
> pmu_ptr->mem_info fails. So in that case we can just return from here, 
> and kfree wont be
> called with a NULL pointer.
>
>>> +    for (; ptr; ptr++) {
>>        for (ptr = pmu_ptr->mem_info; ptr; ptr++) {
>>
>> will do the right thing.

Sorry, replied too soon on this. You are right, with this we can remove 
the if (!ptr) check.
thanks.
>>
>>> +        if (ptr->vbase[0] != 0)
>>> +            free_pages(ptr->vbase[0], 0);
>>> +    }
>> and kfree can be called with a NULL pointer.
>>

Yes right.

Regards,
Anju

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ