diff options
| author | 2008-07-25 10:40:14 -0400 | |
|---|---|---|
| committer | 2008-07-25 10:40:14 -0400 | |
| commit | ff877ea80efa2015b6263766f78ee42c2a1b32f9 (patch) | |
| tree | 85205005c611ab774702148558321c6fb92f1ccd /lib/kobject.c | |
| parent | CPUFREQ: S3C24XX NAND driver frequency scaling support. (diff) | |
| parent | UBI: always start the background thread (diff) | |
Merge branch 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6
Diffstat (limited to 'lib/kobject.c')
| -rw-r--r-- | lib/kobject.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/kobject.c b/lib/kobject.c index 718e5101c263..744401571ed7 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -216,13 +216,19 @@ static int kobject_add_internal(struct kobject *kobj) static int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list vargs) { - /* Free the old name, if necessary. */ - kfree(kobj->name); + const char *old_name = kobj->name; + char *s; kobj->name = kvasprintf(GFP_KERNEL, fmt, vargs); if (!kobj->name) return -ENOMEM; + /* ewww... some of these buggers have '/' in the name ... */ + s = strchr(kobj->name, '/'); + if (s) + s[0] = '!'; + + kfree(old_name); return 0; } @@ -439,6 +445,7 @@ out: return error; } +EXPORT_SYMBOL_GPL(kobject_rename); /** * kobject_move - move object to another parent |
