summaryrefslogtreecommitdiff
path: root/fastboot/fastboot_driver.cpp
diff options
context:
space:
mode:
authorqiwu chen <qiwuchen55@gmail.com>2019-08-29 14:50:51 +0800
committerqiwu chen <qiwuchen55@gmail.com>2019-08-29 14:56:19 +0800
commit325ba6ffa855533a9dbe5289384157faa7789624 (patch)
treee02d7115cff564dc3cefff6cefa4c0891548a170 /fastboot/fastboot_driver.cpp
parent50ca44840288e8892091132423f59642a09eee90 (diff)
fastboot: Initialize UploadInner dsize value to 0
We must initialize UploadInner dsize value to 0, in case stuck in ReadBuffer when receive DATA packet which dsize is 0 or non DATA type packet. This will lead to fastboot hang up unless USB unplugged. Change-Id: I1e9752585c3d1013b1b1da38ead9ba4c532c2d34 Signed-off-by: qiwu chen <qiwuchen55@gmail.com>
Diffstat (limited to 'fastboot/fastboot_driver.cpp')
-rw-r--r--fastboot/fastboot_driver.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/fastboot/fastboot_driver.cpp b/fastboot/fastboot_driver.cpp
index fea0a77e5..b897182a2 100644
--- a/fastboot/fastboot_driver.cpp
+++ b/fastboot/fastboot_driver.cpp
@@ -291,7 +291,7 @@ RetCode FastBootDriver::Upload(const std::string& outfile, std::string* response
RetCode FastBootDriver::UploadInner(const std::string& outfile, std::string* response,
std::vector<std::string>* info) {
RetCode ret;
- int dsize;
+ int dsize = 0;
if ((ret = RawCommand(FB_CMD_UPLOAD, response, info, &dsize))) {
error_ = "Upload request failed: " + error_;
return ret;