lkml.org 
[lkml]   [2013]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kernel/params.c: print failure information instead of 'KOBJ_ADD' to user space, when sysfs_create_file() fails.
On 07/10/2013 11:01 AM, Chen Gang F T wrote:
>
>> > Hmm..., do we need call kobject_get() before kobject_put() in failure
>> > processing block ?
>> >
> Oh, sorry for what I said for kobject_get/put() items above, it is
> incorrect.
>
> What about the diff below for kobject_get() ?
>
> -------------------------------diff begin-------------------------------
>
> diff --git a/kernel/params.c b/kernel/params.c
> index 440e65d..ef8d720 100644
> --- a/kernel/params.c
> +++ b/kernel/params.c
> @@ -754,11 +754,11 @@ static struct module_kobject * __init locate_module_kobject(const char *name)
> name, err);
> return NULL;
> }
> -
> - /* So that we hold reference in both cases. */
> - kobject_get(&mk->kobj);
> }
>
> + /* So that we hold reference in both cases. */
> + kobject_get(&mk->kobj);
> +
> return mk;
> }
>
> -------------------------------diff end---------------------------------
>

Sorry again, this diff is incorrect, the original implementation has no
issues.


> And it also need add additional kobject_put(), if we really need
> process the failure in version_sysfs_builtin().

If need process failure, we really need it, but now, we only use
BUG_ON() is enough.


Thanks.
--
Chen Gang


\
 
 \ /
  Last update: 2013-07-12 02:21    [W:0.044 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site