summaryrefslogtreecommitdiffstats
path: root/lib/kobject.c
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-04-11 11:22:43 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-23 07:14:55 -0400
commit3e14c6abbfb5c94506edda9d8e2c145d79375798 (patch)
tree08c20e52fcc976652b64b9e775b70a28adf4ef30 /lib/kobject.c
parentdf9267f1fb6b56fa573cc93c611009b0bd126878 (diff)
kobject: don't use WARN for registration failures
This WARNING proved to be noisy. The function still returns an error and callers should handle it. That's how most of kernel code works. Downgrade the WARNING to pr_err() and leave WARNINGs for kernel bugs. Signed-off-by: Dmitry Vyukov <dvyukov@google.com> Reported-by: syzbot+209c0f67f99fec8eb14b@syzkaller.appspotmail.com Reported-by: syzbot+7fb6d9525a4528104e05@syzkaller.appspotmail.com Reported-by: syzbot+2e63711063e2d8f9ea27@syzkaller.appspotmail.com Reported-by: syzbot+de73361ee4971b6e6f75@syzkaller.appspotmail.com Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/kobject.c')
-rw-r--r--lib/kobject.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index e1d1f290bf35..18989b5b3b56 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -233,13 +233,12 @@ static int kobject_add_internal(struct kobject *kobj)
233 233
234 /* be noisy on error issues */ 234 /* be noisy on error issues */
235 if (error == -EEXIST) 235 if (error == -EEXIST)
236 WARN(1, 236 pr_err("%s failed for %s with -EEXIST, don't try to register things with the same name in the same directory.\n",
237 "%s failed for %s with -EEXIST, don't try to register things with the same name in the same directory.\n", 237 __func__, kobject_name(kobj));
238 __func__, kobject_name(kobj));
239 else 238 else
240 WARN(1, "%s failed for %s (error: %d parent: %s)\n", 239 pr_err("%s failed for %s (error: %d parent: %s)\n",
241 __func__, kobject_name(kobj), error, 240 __func__, kobject_name(kobj), error,
242 parent ? kobject_name(parent) : "'none'"); 241 parent ? kobject_name(parent) : "'none'");
243 } else 242 } else
244 kobj->state_in_sysfs = 1; 243 kobj->state_in_sysfs = 1;
245 244