diff --git a/fs/aio.c b/fs/aio.c index 63135331cec27b3801375835165726077f61cc35..ad460d78d6c5d9e3c967d9d2560e1847542c3c57 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -196,8 +196,10 @@ static void aio_free_ring(struct kioctx *ctx) put_aio_ring_file(ctx); - if (ctx->ring_pages && ctx->ring_pages != ctx->internal_pages) + if (ctx->ring_pages && ctx->ring_pages != ctx->internal_pages) { kfree(ctx->ring_pages); + ctx->ring_pages = NULL; + } } static int aio_ring_mmap(struct file *file, struct vm_area_struct *vma)