Commit 3e45a109 authored by Linus Torvalds's avatar Linus Torvalds

aio: remove incorrect initialization of "nr_pages"

We should not claim to have filled in the ring_pages[] array
until we actually _do_ fill it in. It will confuse the code
that frees the structure if we claim there are pages there
that don't exist.

Noted by Darrick Wong.
parent 43c261b9
...@@ -118,8 +118,6 @@ static int aio_setup_ring(struct kioctx *ctx) ...@@ -118,8 +118,6 @@ static int aio_setup_ring(struct kioctx *ctx)
if (nr_pages < 0) if (nr_pages < 0)
return -EINVAL; return -EINVAL;
info->nr_pages = nr_pages;
nr_events = (PAGE_SIZE * nr_pages - sizeof(struct aio_ring)) / sizeof(struct io_event); nr_events = (PAGE_SIZE * nr_pages - sizeof(struct aio_ring)) / sizeof(struct io_event);
info->nr = 0; info->nr = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment