mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
kobject: return error code if writing /sys/.../uevent fails
[ Upstream commit df44b47965 ]
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
80eac18479
commit
f7debeebcd
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user