watch_queue: Fix the alloc bitmap size to reflect notes allocated
authorDavid Howells <dhowells@redhat.com>
Fri, 11 Mar 2022 13:24:22 +0000 (13:24 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 11 Mar 2022 18:17:12 +0000 (10:17 -0800)
commit3b4c0371928c17af03e8397ac842346624017ce6
tree30ea1c4919f929abce36123bac9e15e41d1a1181
parenta66bd7575b5f449ee0ba20cfd21c3bc5b04ef361
watch_queue: Fix the alloc bitmap size to reflect notes allocated

Currently, watch_queue_set_size() sets the number of notes available in
wqueue->nr_notes according to the number of notes allocated, but sets
the size of the bitmap to the unrounded number of notes originally asked
for.

Fix this by setting the bitmap size to the number of notes we're
actually going to make available (ie. the number allocated).

Fixes: c73be61cede5 ("pipe: Add general notification queue support")
Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/watch_queue.c