Skip to content

Commit 0002776

Browse files
committed
fix scan build failure
1 parent 8aa3235 commit 0002776

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

src/wh_client_crypto.c

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -194,22 +194,23 @@ static int _SendRecieveWithTimeout(whClientContext* ctx, uint16_t* group,
194194
ret = wh_Client_TimeoutStart(ctx);
195195
}
196196
#endif
197-
198-
do {
199-
ret = wh_Client_RecvResponse(ctx, group, action, res_len, data);
200-
#if defined(WOLFHSM_CFG_CLIENT_TIMEOUT)
201-
if (ret == WH_ERROR_NOTREADY) {
202-
/* Check for crypto timeout */
203-
int chk = wh_Client_TimeoutCheck(ctx);
204-
if (chk == WH_ERROR_TIMEOUT) {
205-
return WH_ERROR_TIMEOUT;
206-
}
207-
else if (chk < 0 && chk != WH_ERROR_OK) {
208-
return chk;
197+
if (ret == WH_ERROR_OK) {
198+
do {
199+
ret = wh_Client_RecvResponse(ctx, group, action, res_len, data);
200+
#if defined(WOLFHSM_CFG_CLIENT_TIMEOUT)
201+
if (ret == WH_ERROR_NOTREADY) {
202+
/* Check for crypto timeout */
203+
int chk = wh_Client_TimeoutCheck(ctx);
204+
if (chk == WH_ERROR_TIMEOUT) {
205+
return WH_ERROR_TIMEOUT;
206+
}
207+
else if (chk < 0 && chk != WH_ERROR_OK) {
208+
return chk;
209+
}
209210
}
210-
}
211-
#endif
212-
} while (ret == WH_ERROR_NOTREADY);
211+
#endif
212+
} while (ret == WH_ERROR_NOTREADY);
213+
}
213214
return ret;
214215
}
215216

0 commit comments

Comments
 (0)