kobject: return error code if writing /sys/.../uevent fails
authorPeter Rajnoha <prajnoha@redhat.com>
Wed, 5 Dec 2018 11:27:44 +0000 (12:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:46:02 +0000 (19:46 +0100)
commit53dedc8d521acf94f6b6c9ed446545f9ca8b86f1
treecafcc8ab73725af17856133063fa43e5ff95d46f
parentbed61b98c78a357e10d790924cff744be0e8fec7
kobject: return error code if writing /sys/.../uevent fails

[ Upstream commit df44b479654f62b478c18ee4d8bc4e9f897a9844 ]

Propagate error code back to userspace if writing the /sys/.../uevent
file fails. Before, the write operation always returned with success,
even if we failed to recognize the input string or if we failed to
generate the uevent itself.

With the error codes properly propagated back to userspace, we are
able to react in userspace accordingly by not assuming and awaiting
a uevent that is not delivered.

Signed-off-by: Peter Rajnoha <prajnoha@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/base/bus.c
drivers/base/core.c
kernel/module.c