diff --git a/e_qat.c b/e_qat.c index 4d33951f..ef6ad2cd 100644 --- a/e_qat.c +++ b/e_qat.c @@ -1207,7 +1207,7 @@ static int qat_engine_finish(ENGINE *e) } if (0 == enable_external_polling && !qat_is_event_driven()) { - if ((pthread_t *) icp_polling_threads[i] != 0) { + if ((pthread_t *) icp_polling_threads[i] != NULL) { pthread_join(icp_polling_threads[i], NULL); } } @@ -1217,7 +1217,7 @@ static int qat_engine_finish(ENGINE *e) } if (0 == enable_external_polling && qat_is_event_driven()) { - if ((pthread_t *) icp_polling_threads[0] != 0) { + if ((pthread_t *) icp_polling_threads[0] != NULL) { pthread_join(icp_polling_threads[0], NULL); } } diff --git a/qat_ciphers.c b/qat_ciphers.c index cc39c348..82f987f3 100644 --- a/qat_ciphers.c +++ b/qat_ciphers.c @@ -327,12 +327,13 @@ static unsigned long pkt_threshold_table_hash(const PKT_THRESHOLD * a) LHASH_OF(PKT_THRESHOLD) *qat_create_pkt_threshold_table(void) { int i; + int tbl_size = (sizeof(qat_pkt_threshold_table) / sizeof(qat_pkt_threshold_table[0])); LHASH_OF(PKT_THRESHOLD) *ret = NULL; ret = lh_PKT_THRESHOLD_new(pkt_threshold_table_hash,pkt_threshold_table_cmp); if(ret == NULL) { return ret; } - for(i = 0; i < sizeof(qat_pkt_threshold_table);i++) { + for(i = 0; i < tbl_size; i++) { lh_PKT_THRESHOLD_insert(ret,&qat_pkt_threshold_table[i]); } return ret;