From 9065c63f405eda290bcee5c7b98311fbe93bdb7c Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 17 Aug 2012 16:42:14 +1000 Subject: [PATCH] Repeating on timeout in ztex could make the code never return. --- libztex.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libztex.c b/libztex.c index e4276a37..ae0ee4ae 100644 --- a/libztex.c +++ b/libztex.c @@ -618,8 +618,7 @@ int libztex_sendHashData(struct libztex_device *ztex, unsigned char *sendbuf) ret -= cnt; len += cnt; } else - if (cnt != LIBUSB_ERROR_TIMEOUT) - break; + break; } if (unlikely(cnt < 0)) applog(LOG_ERR, "%s: Failed sendHashData with err %d", ztex->repr, cnt); @@ -647,8 +646,7 @@ int libztex_readHashData(struct libztex_device *ztex, struct libztex_hash_data n ret -= cnt; len += cnt; } else - if (cnt != LIBUSB_ERROR_TIMEOUT) - break; + break; } if (unlikely(cnt < 0)) {