diff options
author | Luis R. Rodriguez <mcgrof@kernel.org> | 2017-07-20 22:13:39 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-10 22:58:41 +0200 |
commit | 76098b36b5db1a509e5af94128b08f950692c7f8 (patch) | |
tree | d66801f5a1e762628a7732f34af4eb955732d99f /drivers/base/firmware_class.c | |
parent | test_firmware: add test case for SIGCHLD on sync fallback (diff) | |
download | linux-76098b36b5db1a509e5af94128b08f950692c7f8.tar.xz linux-76098b36b5db1a509e5af94128b08f950692c7f8.zip |
firmware: send -EINTR on signal abort on fallback mechanism
Right now we send -EAGAIN to a syfs write which got interrupted.
Userspace can't tell what happened though, send -EINTR if we
were killed due to a signal so userspace can tell things apart.
This is only applicable to the fallback mechanism.
Reported-by: Martin Fuzzey <mfuzzey@parkeon.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/firmware_class.c')
-rw-r--r-- | drivers/base/firmware_class.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index b9f907eedbf7..ac7e32fac8fc 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -1089,9 +1089,12 @@ static int _request_firmware_load(struct firmware_priv *fw_priv, mutex_unlock(&fw_lock); } - if (fw_state_is_aborted(&buf->fw_st)) - retval = -EAGAIN; - else if (buf->is_paged_buf && !buf->data) + if (fw_state_is_aborted(&buf->fw_st)) { + if (retval == -ERESTARTSYS) + retval = -EINTR; + else + retval = -EAGAIN; + } else if (buf->is_paged_buf && !buf->data) retval = -ENOMEM; device_del(f_dev); |