lkml.org 
[lkml]   [2013]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86: mcheck: call put_device on device_register failure
2013-11-30 12:12, Borislav Petkov:
> On Sat, Nov 30, 2013 at 08:30:33AM +0100, Levente Kurusa wrote:
>> No, if the call to put_device gives up the last reference to the
>> device, then device_release gets called which in turn frees the memory
>> associated with it. In this case, mce_device_release() will get
>> called, which is just a simple kfree call.
>
> Aah, that's that delayed freeing the driver core does, right. Now you
> made me go and look into detail:
>
> device_unregister
> |->put_device
> |->kobject_put
> |->kref_put(&kobj->kref, kobject_release)
> |->kref_sub(kref, 1, release)
> |->release
> |->kobject_release
> |->kobject_cleanup
> |->t->release
> |->device_release
> |->mce_device_release
>
Now this tree makes me wonder if there are devices where
the author forgot to set a device_release or when the put_device
is not called. I will take a look into this.
>
> Ok, I see it now. :-) :-)
>
> Thanks, I'll take your patch as-is.
>
Awesome, thanks! :-)


--
Regards,
Levente Kurusa


\
 
 \ /
  Last update: 2013-11-30 12:41    [W:0.077 / U:2.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site