diff options
Diffstat (limited to 'lib/kobject.c')
-rw-r--r-- | lib/kobject.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/kobject.c b/lib/kobject.c index a6dec32f2ddd..bacf6fe4f7a0 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
@@ -218,6 +218,9 @@ int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, | |||
218 | const char *old_name = kobj->name; | 218 | const char *old_name = kobj->name; |
219 | char *s; | 219 | char *s; |
220 | 220 | ||
221 | if (kobj->name && !fmt) | ||
222 | return 0; | ||
223 | |||
221 | kobj->name = kvasprintf(GFP_KERNEL, fmt, vargs); | 224 | kobj->name = kvasprintf(GFP_KERNEL, fmt, vargs); |
222 | if (!kobj->name) | 225 | if (!kobj->name) |
223 | return -ENOMEM; | 226 | return -ENOMEM; |