lkml.org 
[lkml]   [2012]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] drivers/w1: free the w1_master at w1_free_dev and return a correct return value
From
Hi Evgeniy,
On Wed, Jun 20, 2012 at 1:36 PM, Evgeniy Polyakov <zbr@ioremap.net> wrote:
> Hi
>
> On Sun, Jun 17, 2012 at 09:47:59PM +0530, Devendra Naga (devendra.aaru@gmail.com) wrote:
>> the w1_master pointer is allced at the w1_alloc_master and is not freed when called with
>> w1_remove_master.
>>
>> when w1_alloc_dev fails the return should be -ENODEV as it does
>> device_register, and that is the last case where that function
>> will fail.
>>
>> Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
>
> Hmm, looks correct, but I wonder how whatever_free() function happend
> not to free its arguments.
>
I think , it its good to have the kfree after calling the w1_free_dev
as this way looks so wierd calling of kfree.
> Looks like device_unregister() calls release callback, but we do not
> provide one.
>
vim -t device_unregister points me to drivers/base/core.c
device_unregister function, where we do a device_del, where we do a
dev_release_all where it calls release_nodes which calls the release
callback. is that what you are telling?

if so actually we are passing the structure w1_master_device which is
of struct device. its having a release callback. and there we free the
master device.

please suggest me if i mistaken....
> Greg, please pull it into your tree. Thank you.
> Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
>
> --
>        Evgeniy Polyakov

Thanks,
Devendra.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-06-20 15:41    [W:0.133 / U:3.308 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site