提交 3e14c6ab 编写于 作者: D Dmitry Vyukov 提交者: Greg Kroah-Hartman

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: NDmitry 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: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 df9267f1
...@@ -233,13 +233,12 @@ static int kobject_add_internal(struct kobject *kobj) ...@@ -233,13 +233,12 @@ static int kobject_add_internal(struct kobject *kobj)
/* be noisy on error issues */ /* be noisy on error issues */
if (error == -EEXIST) if (error == -EEXIST)
WARN(1, pr_err("%s failed for %s with -EEXIST, don't try to register things with the same name in the same directory.\n",
"%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));
__func__, kobject_name(kobj));
else else
WARN(1, "%s failed for %s (error: %d parent: %s)\n", pr_err("%s failed for %s (error: %d parent: %s)\n",
__func__, kobject_name(kobj), error, __func__, kobject_name(kobj), error,
parent ? kobject_name(parent) : "'none'"); parent ? kobject_name(parent) : "'none'");
} else } else
kobj->state_in_sysfs = 1; kobj->state_in_sysfs = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册