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] [day] [month] [year] [list]
Message-ID: <4f693209-db25-2dfb-1018-3dcbe806104f@gmail.com>
Date:   Thu, 1 Mar 2018 16:54:48 +0530
From:   Arvind Yadav <arvind.yadav.cs@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] driver core: Free memory obtained by kzalloc

Hi Andy,

sorry for noise.

On Thursday 01 March 2018 04:24 PM, Andy Shevchenko wrote:
> On Thu, Mar 1, 2018 at 7:59 AM, Arvind Yadav <arvind.yadav.cs@...il.com> wrote:
>> Here kfree() is taking NULL. So moving 'dev = NULL' after kfree().
> Ouch! Does system_root_device_release() code ring a bell? How did you test this?
Yes, This is fine. put_device() will decrement a ref count.
So No need to call kfree() after put_device().
>
> When you start eventually looking to the code?
>
> NAK.
>
>> diff --git a/drivers/base/bus.c b/drivers/base/bus.c
>> index ef61833..ccb64a0 100644
>> --- a/drivers/base/bus.c
>> +++ b/drivers/base/bus.c
>> @@ -1170,9 +1170,9 @@ static int subsys_register(struct bus_type *subsys,
>>
>>   err_dev_reg:
>>          put_device(dev);
>> -       dev = NULL;
>>   err_name:
>>          kfree(dev);
>> +       dev = NULL;
>>   err_dev:
>>          bus_unregister(subsys);
>>          return err;
Thanks for your review.
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ