summaryrefslogtreecommitdiff
path: root/drivers/android/binder.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2022-05-11 12:37:19 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-05-11 12:37:19 -0300
commit467cd948f8a92086441dd9b9859885132f1adc35 (patch)
treedf940b0e885f7c670ecf80249aeb760b2d09a663 /drivers/android/binder.c
parentcad10ce36671c99dde850de7bd4ca0d8df66c47f (diff)
parentfeb9c5e19e913b53cb536a7aa7c9f20107bb51ec (diff)
downloadlinux-467cd948f8a92086441dd9b9859885132f1adc35.tar.gz
linux-467cd948f8a92086441dd9b9859885132f1adc35.tar.bz2
linux-467cd948f8a92086441dd9b9859885132f1adc35.zip
Merge remote-tracking branch 'torvalds/master' into perf/core
Get fixes sent via perf/urgent, etc. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'drivers/android/binder.c')
-rw-r--r--drivers/android/binder.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 8351c5638880..f3b639e89dd8 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -2295,6 +2295,7 @@ static int binder_do_deferred_txn_copies(struct binder_alloc *alloc,
{
int ret = 0;
struct binder_sg_copy *sgc, *tmpsgc;
+ struct binder_ptr_fixup *tmppf;
struct binder_ptr_fixup *pf =
list_first_entry_or_null(pf_head, struct binder_ptr_fixup,
node);
@@ -2349,7 +2350,11 @@ static int binder_do_deferred_txn_copies(struct binder_alloc *alloc,
list_del(&sgc->node);
kfree(sgc);
}
- BUG_ON(!list_empty(pf_head));
+ list_for_each_entry_safe(pf, tmppf, pf_head, node) {
+ BUG_ON(pf->skip_size == 0);
+ list_del(&pf->node);
+ kfree(pf);
+ }
BUG_ON(!list_empty(sgc_head));
return ret > 0 ? -EINVAL : ret;
@@ -2486,6 +2491,9 @@ static int binder_translate_fd_array(struct list_head *pf_head,
struct binder_proc *proc = thread->proc;
int ret;
+ if (fda->num_fds == 0)
+ return 0;
+
fd_buf_size = sizeof(u32) * fda->num_fds;
if (fda->num_fds >= SIZE_MAX / sizeof(u32)) {
binder_user_error("%d:%d got transaction with invalid number of fds (%lld)\n",