binder: propagate vm_insert_page() errors
authorCarlos Llamas <cmllamas@google.com>
Tue, 10 Dec 2024 14:31:04 +0000 (14:31 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Dec 2024 08:35:23 +0000 (09:35 +0100)
Instead of always overriding errors with -ENOMEM, propagate the specific
error code returned by vm_insert_page(). This allows for more accurate
error logs and handling.

Cc: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20241210143114.661252-9-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder_alloc.c

index f86bd6ded4f465a1fcc084b32cc58efa3fa456a6..b2b97ff19ba2dd920149e978e7707aca095ae103 100644 (file)
@@ -353,7 +353,6 @@ static int binder_install_single_page(struct binder_alloc *alloc,
                binder_free_page(page);
                pr_err("%d: %s failed to insert page at offset %lx with %d\n",
                       alloc->pid, __func__, addr - alloc->vm_start, ret);
-               ret = -ENOMEM;
                break;
        }
 out: