summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-04-11 17:22:43 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-02 07:59:55 -0700
commitb2497363fa7beed9f714d983d0f6a53091f3f729 (patch)
treefc57d5c35c9a390400ef0c801baa30b335bc4cf1
parent2365af7dba0ea7b12e93bb0c80bac6c16d51861c (diff)
downloadlinux-stable-b2497363fa7beed9f714d983d0f6a53091f3f729.tar.gz
linux-stable-b2497363fa7beed9f714d983d0f6a53091f3f729.tar.bz2
linux-stable-b2497363fa7beed9f714d983d0f6a53091f3f729.zip
kobject: don't use WARN for registration failures
commit 3e14c6abbfb5c94506edda9d8e2c145d79375798 upstream. 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>
-rw-r--r--lib/kobject.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index 58751bb80a7c..69acdbc3b43c 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -234,14 +234,12 @@ static int kobject_add_internal(struct kobject *kobj)
/* be noisy on error issues */
if (error == -EEXIST)
- WARN(1, "%s failed for %s with "
- "-EEXIST, don't try to register things with "
- "the same name in the same directory.\n",
- __func__, kobject_name(kobj));
+ pr_err("%s failed for %s with -EEXIST, don't try to register things with the same name in the same directory.\n",
+ __func__, kobject_name(kobj));
else
- WARN(1, "%s failed for %s (error: %d parent: %s)\n",
- __func__, kobject_name(kobj), error,
- parent ? kobject_name(parent) : "'none'");
+ pr_err("%s failed for %s (error: %d parent: %s)\n",
+ __func__, kobject_name(kobj), error,
+ parent ? kobject_name(parent) : "'none'");
} else
kobj->state_in_sysfs = 1;