diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2024-07-20 03:19:02 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2024-11-03 07:28:06 +0100 |
commit | 8152f8201088350c76bb9685cd5990dd51d59aff (patch) | |
tree | d8c16f772fd79b751e19b29d420b6818239c94e6 /security/loadpin | |
parent | fdget(), trivial conversions (diff) | |
download | linux-8152f8201088350c76bb9685cd5990dd51d59aff.tar.xz linux-8152f8201088350c76bb9685cd5990dd51d59aff.zip |
fdget(), more trivial conversions
all failure exits prior to fdget() leave the scope, all matching fdput()
are immediately followed by leaving the scope.
[xfs_ioc_commit_range() chunk moved here as well]
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security/loadpin')
-rw-r--r-- | security/loadpin/loadpin.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/security/loadpin/loadpin.c b/security/loadpin/loadpin.c index 02144ec39f43..68252452b66c 100644 --- a/security/loadpin/loadpin.c +++ b/security/loadpin/loadpin.c @@ -283,7 +283,6 @@ enum loadpin_securityfs_interface_index { static int read_trusted_verity_root_digests(unsigned int fd) { - struct fd f; void *data; int rc; char *p, *d; @@ -295,8 +294,8 @@ static int read_trusted_verity_root_digests(unsigned int fd) if (!list_empty(&dm_verity_loadpin_trusted_root_digests)) return -EPERM; - f = fdget(fd); - if (!fd_file(f)) + CLASS(fd, f)(fd); + if (fd_empty(f)) return -EINVAL; data = kzalloc(SZ_4K, GFP_KERNEL); @@ -359,7 +358,6 @@ static int read_trusted_verity_root_digests(unsigned int fd) } kfree(data); - fdput(f); return 0; @@ -379,8 +377,6 @@ err: /* disallow further attempts after reading a corrupt/invalid file */ deny_reading_verity_digests = true; - fdput(f); - return rc; } |