From e7d41267ad9a204ee71fe04c4a792790b7524cc2 Mon Sep 17 00:00:00 2001 From: Todd Kjos Date: Wed, 27 Mar 2019 16:12:31 -0700 Subject: [PATCH] ANDROID: binder: remove extra declaration left after backport When backporting commit 1a7c3d9bb7a9 ("binder: create userspace-to-binder-buffer copy function"), an extra "int target_fd;" was left in the code. This resulted in the possibility of accessing an uninitialized variable which was flagged by gcc. Bug: 67668716 Change-Id: I787ed89579e9d40e8530d79be67cc663ec755e54 Signed-off-by: Todd Kjos --- drivers/android/binder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 36ad7483424c..64824dc8fc22 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -2781,7 +2781,7 @@ static int binder_translate_fd_array(struct binder_fd_array_object *fda, } for (fdi = 0; fdi < fda->num_fds; fdi++) { u32 fd; - int target_fd; + binder_size_t offset = fda_offset + fdi * sizeof(fd); binder_alloc_copy_from_buffer(&target_proc->alloc, -- 2.20.1