diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2018-12-05 12:27:44 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-06 16:07:43 +0100 |
commit | df44b479654f62b478c18ee4d8bc4e9f897a9844 (patch) | |
tree | 2c028dc441857a753c6341bacbb86b9a6e9a5e07 /kernel | |
parent | c37d721c68ad88925ba0e72f6e14acb829a8c6bb (diff) | |
download | linux-df44b479654f62b478c18ee4d8bc4e9f897a9844.tar.gz linux-df44b479654f62b478c18ee4d8bc4e9f897a9844.tar.bz2 linux-df44b479654f62b478c18ee4d8bc4e9f897a9844.zip |
kobject: return error code if writing /sys/.../uevent fails
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/module.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/module.c b/kernel/module.c index 49a405891587..0812a7f80fa7 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -1207,8 +1207,10 @@ static ssize_t store_uevent(struct module_attribute *mattr, struct module_kobject *mk, const char *buffer, size_t count) { - kobject_synth_uevent(&mk->kobj, buffer, count); - return count; + int rc; + + rc = kobject_synth_uevent(&mk->kobj, buffer, count); + return rc ? rc : count; } struct module_attribute module_uevent = |