Skip to content

Commit d1c29eb

Browse files
committed
fix scan build failure
1 parent 43e8c75 commit d1c29eb

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
@@ -193,22 +193,23 @@ static int _SendRecieveWithTimeout(whClientContext* ctx, uint16_t* group,
193193
ret = wh_Client_TimeoutStart(ctx);
194194
}
195195
#endif
196-
197-
do {
198-
ret = wh_Client_RecvResponse(ctx, group, action, res_len, data);
199-
#if defined(WOLFHSM_CFG_CLIENT_TIMEOUT)
200-
if (ret == WH_ERROR_NOTREADY) {
201-
/* Check for crypto timeout */
202-
int chk = wh_Client_TimeoutCheck(ctx);
203-
if (chk == WH_ERROR_TIMEOUT) {
204-
return WH_ERROR_TIMEOUT;
205-
}
206-
else if (chk < 0 && chk != WH_ERROR_OK) {
207-
return chk;
196+
if (ret == WH_ERROR_OK) {
197+
do {
198+
ret = wh_Client_RecvResponse(ctx, group, action, res_len, data);
199+
#if defined(WOLFHSM_CFG_CLIENT_TIMEOUT)
200+
if (ret == WH_ERROR_NOTREADY) {
201+
/* Check for crypto timeout */
202+
int chk = wh_Client_TimeoutCheck(ctx);
203+
if (chk == WH_ERROR_TIMEOUT) {
204+
return WH_ERROR_TIMEOUT;
205+
}
206+
else if (chk < 0 && chk != WH_ERROR_OK) {
207+
return chk;
208+
}
208209
}
209-
}
210-
#endif
211-
} while (ret == WH_ERROR_NOTREADY);
210+
#endif
211+
} while (ret == WH_ERROR_NOTREADY);
212+
}
212213
return ret;
213214
}
214215

0 commit comments

Comments
 (0)