Skip to content

Commit a18dcb5

Browse files
Yogaraj-Alamendastevelinsell
authored andcommitted
Fix array indexing error and compilation warning
Change-Id: I3cc3b3ca2e32a94dee284615ce5e9bed35abc85c Signed-off-by: Steve Linsell <stevenx.linsell@intel.com>
1 parent cbbf939 commit a18dcb5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

e_qat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ static int qat_engine_finish(ENGINE *e)
12071207
}
12081208

12091209
if (0 == enable_external_polling && !qat_is_event_driven()) {
1210-
if ((pthread_t *) icp_polling_threads[i] != 0) {
1210+
if ((pthread_t *) icp_polling_threads[i] != NULL) {
12111211
pthread_join(icp_polling_threads[i], NULL);
12121212
}
12131213
}
@@ -1217,7 +1217,7 @@ static int qat_engine_finish(ENGINE *e)
12171217
}
12181218

12191219
if (0 == enable_external_polling && qat_is_event_driven()) {
1220-
if ((pthread_t *) icp_polling_threads[0] != 0) {
1220+
if ((pthread_t *) icp_polling_threads[0] != NULL) {
12211221
pthread_join(icp_polling_threads[0], NULL);
12221222
}
12231223
}

qat_ciphers.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,12 +327,13 @@ static unsigned long pkt_threshold_table_hash(const PKT_THRESHOLD * a)
327327
LHASH_OF(PKT_THRESHOLD) *qat_create_pkt_threshold_table(void)
328328
{
329329
int i;
330+
int tbl_size = (sizeof(qat_pkt_threshold_table) / sizeof(qat_pkt_threshold_table[0]));
330331
LHASH_OF(PKT_THRESHOLD) *ret = NULL;
331332
ret = lh_PKT_THRESHOLD_new(pkt_threshold_table_hash,pkt_threshold_table_cmp);
332333
if(ret == NULL) {
333334
return ret;
334335
}
335-
for(i = 0; i < sizeof(qat_pkt_threshold_table);i++) {
336+
for(i = 0; i < tbl_size; i++) {
336337
lh_PKT_THRESHOLD_insert(ret,&qat_pkt_threshold_table[i]);
337338
}
338339
return ret;

0 commit comments

Comments
 (0)