Skip to content

Commit 76098b3

Browse files
mcgrofgregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0d1f417 commit 76098b3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/base/firmware_class.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,9 +1089,12 @@ static int _request_firmware_load(struct firmware_priv *fw_priv,
10891089
mutex_unlock(&fw_lock);
10901090
}
10911091

1092-
if (fw_state_is_aborted(&buf->fw_st))
1093-
retval = -EAGAIN;
1094-
else if (buf->is_paged_buf && !buf->data)
1092+
if (fw_state_is_aborted(&buf->fw_st)) {
1093+
if (retval == -ERESTARTSYS)
1094+
retval = -EINTR;
1095+
else
1096+
retval = -EAGAIN;
1097+
} else if (buf->is_paged_buf && !buf->data)
10951098
retval = -ENOMEM;
10961099

10971100
device_del(f_dev);

0 commit comments

Comments
 (0)