summaryrefslogtreecommitdiff
path: root/fs/signalfd.c
diff options
context:
space:
mode:
authorFedor Pchelkin <pchelkin@ispras.ru>2024-05-20 12:08:18 +0300
committerChristian Brauner <brauner@kernel.org>2024-05-24 13:34:07 +0200
commitf826bc9d6fc2f0e089fb8d104415d72e4d2e204c (patch)
treece577f01f05770ccd7be32538e0a01dd1d025826 /fs/signalfd.c
parent4e527d5841e24623181edc7fd6f6598ffa810e10 (diff)
downloadlwn-f826bc9d6fc2f0e089fb8d104415d72e4d2e204c.tar.gz
lwn-f826bc9d6fc2f0e089fb8d104415d72e4d2e204c.zip
signalfd: fix error return code
If anon_inode_getfile() fails, return appropriate error code. This looks like a single typo: the similar code changes in timerfd and userfaultfd are okay. Found by Linux Verification Center (linuxtesting.org). Fixes: fbe38120eb1d ("signalfd: convert to ->read_iter()") Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Link: https://lore.kernel.org/r/20240520090819.76342-1-pchelkin@ispras.ru Reviewed-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/signalfd.c')
-rw-r--r--fs/signalfd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/signalfd.c b/fs/signalfd.c
index 4a5614442dbf..65fe5eed0be4 100644
--- a/fs/signalfd.c
+++ b/fs/signalfd.c
@@ -282,7 +282,7 @@ static int do_signalfd4(int ufd, sigset_t *mask, int flags)
if (IS_ERR(file)) {
put_unused_fd(ufd);
kfree(ctx);
- return ufd;
+ return PTR_ERR(file);
}
file->f_mode |= FMODE_NOWAIT;