]> Git Repo - linux.git/commitdiff
signalfd: fix error return code
authorFedor Pchelkin <[email protected]>
Mon, 20 May 2024 09:08:18 +0000 (12:08 +0300)
committerChristian Brauner <[email protected]>
Fri, 24 May 2024 11:34:07 +0000 (13:34 +0200)
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Jens Axboe <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
fs/signalfd.c

index 4a5614442dbfa733ff2dc9fa704532e8b5cc147c..65fe5eed0be4cd30f239d0e8f9451a090779495b 100644 (file)
@@ -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;
 
This page took 0.056513 seconds and 4 git commands to generate.