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:47:06 +0000 (19:47 +0100)
commitf7debeebcdeb1bc699fe8c2dcd313d30aec33644
tree690d6b27b2b3dacd791320f818f4c0abcd70b400
parent80eac18479508a392df2b32d53fdc3ec4e687bd1
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