ipmi: fix platform return check
[deliverable/linux.git] / lib / kobject.c
index 0487d1f64806c645927fdc22ea4a5848f3d9ea5f..bacf6fe4f7a0347bb958ebc85a059ab582eb93b4 100644 (file)
@@ -212,12 +212,15 @@ static int kobject_add_internal(struct kobject *kobj)
  * @fmt: format string used to build the name
  * @vargs: vargs to format the string.
  */
-static int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
+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;
+
        kobj->name = kvasprintf(GFP_KERNEL, fmt, vargs);
        if (!kobj->name)
                return -ENOMEM;
This page took 0.023074 seconds and 5 git commands to generate.