binder: fix async space check for 0-sized buffers
authorCarlos Llamas <cmllamas@google.com>
Fri, 1 Dec 2023 17:21:33 +0000 (17:21 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Dec 2023 00:23:38 +0000 (09:23 +0900)
commit3091c21d3e9322428691ce0b7a0cfa9c0b239eeb
tree2fc0c7ed2e5e1bdecffb05c27b630689f2fa73a4
parent9a9ab0d963621d9d12199df9817e66982582d5a5
binder: fix async space check for 0-sized buffers

Move the padding of 0-sized buffers to an earlier stage to account for
this round up during the alloc->free_async_space check.

Fixes: 74310e06be4d ("android: binder: Move buffer out of area shared with user space")
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20231201172212.1813387-5-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder_alloc.c