lkml.org 
[lkml]   [2014]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sysfs: driver core: Fix glue dir race condition
>> +static DEFINE_MUTEX(gdp_mutex);
>>
>> static struct kobject *get_device_parent(struct device *dev,
>> struct device *parent)
>> {
>> if (dev->class) {
>> - static DEFINE_MUTEX(gdp_mutex);
>> struct kobject *kobj = NULL;
>> struct kobject *parent_kobj;
>> struct kobject *k;
>> @@ -793,7 +793,9 @@ static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
>> glue_dir->kset != &dev->class->p->glue_dirs)
>> return;
>>
>> + mutex_lock(&gdp_mutex);
>> kobject_put(glue_dir);
>> + mutex_unlock(&gdp_mutex);
>> }
>>
>> static void cleanup_device_parent(struct device *dev)
>>
>
> I much prefer this patch over the other one, as it keeps the same
> behavior as today, and fixes the existing bug.
>
> Have you tested it out to see if it works properly? If so, can you
> resend it in a "proper" form so I can apply it?

Yes, we tested it in our system, I will resend it now, thanks!

>
> thanks,
>
> greg k-h
>
> .
>


--
Thanks!
Yijing



\
 
 \ /
  Last update: 2014-11-07 04:41    [W:0.137 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site