From b019574476a65de0503a856be463a5c4c9c74609 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Mon, 18 Mar 2019 14:11:28 -0700 Subject: [PATCH] adb: fix uninitialized variable. Previously, we were initializing IoBlock::pending when submitting a read, but leaving it uninitialized when doing a write, which would sometimes result in an assertion firing when we received a previously allocated block of memory that happened to have a nonzero value in pending. Test: treehugger Change-Id: I434c65f554ceed313fea9cfcc98788908f3ca8bc --- adb/daemon/usb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adb/daemon/usb.cpp b/adb/daemon/usb.cpp index f4458a2c8..d07a00709 100644 --- a/adb/daemon/usb.cpp +++ b/adb/daemon/usb.cpp @@ -115,7 +115,7 @@ struct TransferId { }; struct IoBlock { - bool pending; + bool pending = false; struct iocb control; std::shared_ptr payload;