From 89ab3c27610d441479c6e4133c73043762191b5a Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Sun, 4 Jan 2015 13:35:47 +0100 Subject: [PATCH] Fix uninitialized variable (should fix libusb retry handling) Reported by cppcheck Change-Id: I5ac7b73f2e3eaee3d5427d118944613e572f684d --- utils/atj2137/adfuload/adfuload.c | 1 + utils/rk27utils/rkusbtool/rkusbtool.c | 1 + 2 files changed, 2 insertions(+) diff --git a/utils/atj2137/adfuload/adfuload.c b/utils/atj2137/adfuload/adfuload.c index 82bbc9d100..6471a53eb8 100644 --- a/utils/atj2137/adfuload/adfuload.c +++ b/utils/atj2137/adfuload/adfuload.c @@ -74,6 +74,7 @@ static int send_msc_cmd(libusb_device_handle *hdev, void *cbwcb, uint32_t data_l struct CBW_t cbw; int ret, repeat, transferred; + repeat = 0; memset(&cbw, 0, sizeof(cbw)); cbw.dCBWSignature = CBW_SIGNATURE; cbw.dCBWTag = 0; diff --git a/utils/rk27utils/rkusbtool/rkusbtool.c b/utils/rk27utils/rkusbtool/rkusbtool.c index afe6171e64..a28f217e30 100644 --- a/utils/rk27utils/rkusbtool/rkusbtool.c +++ b/utils/rk27utils/rkusbtool/rkusbtool.c @@ -75,6 +75,7 @@ static int send_msc_cmd(libusb_device_handle *hdev, struct CBWCB_t *cbwcb, uint3 int ret, repeat, transferred; static uint32_t tag = 0xdaefbc01; + repeat = 0; memset(&cbw, 0, sizeof(cbw)); cbw.dCBWSignature = CBW_SIGNATURE; cbw.dCBWTag = tag++;