mirror of
https://github.com/intel/isa-l.git
synced 2025-10-28 19:51:56 +01:00
erasure_code: various fixes for static code analysis issues
Signed-off-by: Tomasz Kantecki <tomasz.kantecki@intel.com>
This commit is contained in:
committed by
Marcel Cornu
parent
ac2ee91cdb
commit
402bd4f773
@@ -179,7 +179,6 @@ int main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
m = k + p;
|
||||
|
||||
if (nerrs > k) {
|
||||
printf
|
||||
@@ -188,6 +187,16 @@ int main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (k <= 0) {
|
||||
printf("Number of source buffers (%d) must be > 0\n", k);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (p <= 0) {
|
||||
printf("Number of parity buffers (%d) must be > 0\n", p);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (nerrs > p) {
|
||||
printf
|
||||
("Number of errors (%d) cannot be higher than number of parity buffers (%d)\n",
|
||||
@@ -195,13 +204,20 @@ int main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (nerrs <= 0) {
|
||||
printf("Number of errors (%d) must be > 0\n", nerrs);
|
||||
return -1;
|
||||
}
|
||||
|
||||
m = k + p;
|
||||
|
||||
if (m > MMAX) {
|
||||
printf("Number of total buffers (data and parity) cannot be higher than %d\n",
|
||||
MMAX);
|
||||
return -1;
|
||||
}
|
||||
|
||||
u8 *err_list = malloc(nerrs);
|
||||
u8 *err_list = malloc((size_t)nerrs);
|
||||
if (err_list == NULL) {
|
||||
printf("Error allocating list of array of error indices\n");
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user