Skip to content

Commit 972acfb

Browse files
committed
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull misc fixes from Al Viro: "A few regression fixes from this cycle" * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: aio: use kmem_cache_free() instead of kfree() iov_iter: Fix build error without CONFIG_CRYPTO aio: Fix an error code in __io_submit_one()
2 parents 869e330 + 6af1c84 commit 972acfb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

fs/aio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ static inline struct aio_kiocb *aio_get_req(struct kioctx *ctx)
10341034
return NULL;
10351035

10361036
if (unlikely(!get_reqs_available(ctx))) {
1037-
kfree(req);
1037+
kmem_cache_free(kiocb_cachep, req);
10381038
return NULL;
10391039
}
10401040

@@ -1794,7 +1794,7 @@ static int __io_submit_one(struct kioctx *ctx, const struct iocb *iocb,
17941794
*/
17951795
eventfd = eventfd_ctx_fdget(iocb->aio_resfd);
17961796
if (IS_ERR(eventfd))
1797-
return PTR_ERR(req->ki_eventfd);
1797+
return PTR_ERR(eventfd);
17981798

17991799
req->ki_eventfd = eventfd;
18001800
}

lib/iov_iter.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,7 @@ EXPORT_SYMBOL(csum_and_copy_to_iter);
15281528
size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp,
15291529
struct iov_iter *i)
15301530
{
1531+
#ifdef CONFIG_CRYPTO
15311532
struct ahash_request *hash = hashp;
15321533
struct scatterlist sg;
15331534
size_t copied;
@@ -1537,6 +1538,9 @@ size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp,
15371538
ahash_request_set_crypt(hash, &sg, NULL, copied);
15381539
crypto_ahash_update(hash);
15391540
return copied;
1541+
#else
1542+
return 0;
1543+
#endif
15401544
}
15411545
EXPORT_SYMBOL(hash_and_copy_to_iter);
15421546

0 commit comments

Comments
 (0)