summaryrefslogtreecommitdiff
path: root/fs/file.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2024-01-20 06:20:36 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2024-04-15 16:03:24 -0400
commit613aee94dddf07de9fde8dd4fcb6e4579cde8a65 (patch)
tree183454f99e1471628ae57fa500e326825ec6e5c1 /fs/file.c
parentc4aab26253cd1f302279b8d6b5b66ccf1b120520 (diff)
get_file_rcu(): no need to check for NULL separately
IS_ERR(NULL) is false and IS_ERR() already comes with unlikely()... Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/file.c')
-rw-r--r--fs/file.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/file.c b/fs/file.c
index ab38b005633c..8076aef9c210 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -920,13 +920,8 @@ struct file *get_file_rcu(struct file __rcu **f)
struct file __rcu *file;
file = __get_file_rcu(f);
- if (unlikely(!file))
- return NULL;
-
- if (unlikely(IS_ERR(file)))
- continue;
-
- return file;
+ if (!IS_ERR(file))
+ return file;
}
}
EXPORT_SYMBOL_GPL(get_file_rcu);