OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mason...
[uclinux-h8/linux.git]
/
lib
/
kobject.c
diff --git
a/lib/kobject.c
b/lib/kobject.c
index
3b841b9
..
2e3bd01
100644
(file)
--- a/
lib/kobject.c
+++ b/
lib/kobject.c
@@
-257,23
+257,20
@@
static int kobject_add_internal(struct kobject *kobj)
int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
va_list vargs)
{
int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
va_list vargs)
{
- const char *old_name = kobj->name;
char *s;
if (kobj->name && !fmt)
return 0;
char *s;
if (kobj->name && !fmt)
return 0;
- kobj->name = kvasprintf(GFP_KERNEL, fmt, vargs);
- if (!kobj->name) {
- kobj->name = old_name;
+ s = kvasprintf(GFP_KERNEL, fmt, vargs);
+ if (!s)
return -ENOMEM;
return -ENOMEM;
- }
/* ewww... some of these buggers have '/' in the name ... */
/* ewww... some of these buggers have '/' in the name ... */
- while ((s = strchr(kobj->name, '/')))
- s[0] = '!';
+ strreplace(s, '/', '!');
+ kfree(kobj->name);
+ kobj->name = s;
- kfree(old_name);
return 0;
}
return 0;
}
@@
-548,6
+545,7
@@
out:
kfree(devpath);
return error;
}
kfree(devpath);
return error;
}
+EXPORT_SYMBOL_GPL(kobject_move);
/**
* kobject_del - unlink kobject from hierarchy.
/**
* kobject_del - unlink kobject from hierarchy.