summaryrefslogtreecommitdiffstats
path: root/fs/verity/verify.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/verity/verify.c')
-rw-r--r--fs/verity/verify.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/fs/verity/verify.c b/fs/verity/verify.c
index 7fa561c343c2..e0cb62da3864 100644
--- a/fs/verity/verify.c
+++ b/fs/verity/verify.c
@@ -192,13 +192,12 @@ bool fsverity_verify_page(struct page *page)
struct ahash_request *req;
bool valid;
- req = ahash_request_alloc(vi->tree_params.hash_alg->tfm, GFP_NOFS);
- if (unlikely(!req))
- return false;
+ /* This allocation never fails, since it's mempool-backed. */
+ req = fsverity_alloc_hash_request(vi->tree_params.hash_alg, GFP_NOFS);
valid = verify_page(inode, vi, req, page, 0);
- ahash_request_free(req);
+ fsverity_free_hash_request(vi->tree_params.hash_alg, req);
return valid;
}
@@ -229,12 +228,8 @@ void fsverity_verify_bio(struct bio *bio)
struct bvec_iter_all iter_all;
unsigned long max_ra_pages = 0;
- req = ahash_request_alloc(params->hash_alg->tfm, GFP_NOFS);
- if (unlikely(!req)) {
- bio_for_each_segment_all(bv, bio, iter_all)
- SetPageError(bv->bv_page);
- return;
- }
+ /* This allocation never fails, since it's mempool-backed. */
+ req = fsverity_alloc_hash_request(params->hash_alg, GFP_NOFS);
if (bio->bi_opf & REQ_RAHEAD) {
/*
@@ -262,7 +257,7 @@ void fsverity_verify_bio(struct bio *bio)
SetPageError(page);
}
- ahash_request_free(req);
+ fsverity_free_hash_request(params->hash_alg, req);
}
EXPORT_SYMBOL_GPL(fsverity_verify_bio);
#endif /* CONFIG_BLOCK */