Commit d6270e10 authored by Mathieu Faverge's avatar Mathieu Faverge

Sonarqube bug fixes

parent adb41a00
......@@ -430,6 +430,7 @@ int MORSE_Desc_Create(MORSE_desc_t **descptr, void *mat, MORSE_enum dtyp, int mb
if ((desc->mat = RUNTIME_malloc(size)) == NULL) {
morse_error("MORSE_Desc_Create", "malloc() failed");
free(desc);
return MORSE_ERR_OUT_OF_RESOURCES;
}
desc->use_mat = 1;
......
......@@ -142,7 +142,7 @@ int morse_alloc_ipiv(int M, int N, MORSE_enum func, int type, MORSE_desc_t **des
ln = NB * NT;
size = (size_t)(chameleon_min(MT, NT) * NB * NT * sizeof(int));
if (size <= 0) {
if (size == 0) {
*IPIV = NULL;
return MORSE_SUCCESS;
}
......
......@@ -188,7 +188,8 @@ morse_parsec_key_to_string(parsec_data_collection_t *data_collection, parsec_dat
res = snprintf(buffer, buffer_size, "(%d, %d)", m, n);
if (res < 0)
{
printf("error in key_to_string for tile (%u, %u) key: %u\n", m, n, datakey);
printf("error in key_to_string for tile (%u, %u) key: %u\n",
(unsigned int)m, (unsigned int)n, datakey);
}
return res;
}
......
......@@ -25,10 +25,10 @@
#endif
#ifdef CHAMELEON_ENABLE_PRUNING_STATS
unsigned long RUNTIME_total_tasks;
unsigned long RUNTIME_exec_tasks;
unsigned long RUNTIME_comm_tasks;
unsigned long RUNTIME_changed_tasks;
unsigned long RUNTIME_total_tasks = 0;
unsigned long RUNTIME_exec_tasks = 0;
unsigned long RUNTIME_comm_tasks = 0;
unsigned long RUNTIME_changed_tasks = 0;
#endif
double RUNTIME_get_time(){
......@@ -81,7 +81,8 @@ void RUNTIME_start_stats(){
void RUNTIME_stop_stats(){
#ifdef CHAMELEON_ENABLE_PRUNING_STATS
fprintf(stderr, "\ntasks: %u = exec: %u + comm: %u + changed: %u\n", RUNTIME_total_tasks, RUNTIME_exec_tasks, RUNTIME_comm_tasks, RUNTIME_changed_tasks);
fprintf( stderr, "\ntasks: %ul = exec: %ul + comm: %ul + changed: %ul\n",
RUNTIME_total_tasks, RUNTIME_exec_tasks, RUNTIME_comm_tasks, RUNTIME_changed_tasks );
#endif
}
......
......@@ -88,9 +88,9 @@ int testing_zgemm(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Cinit) || (!Cfinal) )
if ( (!A) || (!B) || (!C) || (!Cinit) || (!Cfinal) )
{
free(A); free(B);
free(A); free(B); free(C);
free(Cinit); free(Cfinal);
printf("Out of Memory \n ");
return -2;
......
......@@ -170,7 +170,10 @@ Test(int64_t n, int *iparam) {
if ( iparam[IPARAM_WARMUP] ) {
int status = RunTest( iparam, dparam, &(t[0]));
if (status != MORSE_SUCCESS) return status;
if (status != MORSE_SUCCESS) {
free(t);
return status;
}
}
sumgf = 0.0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment