mirror of
https://github.com/upa/mscp.git
synced 2026-02-24 00:44:44 +08:00
check invalid coremask
This commit is contained in:
@@ -174,8 +174,8 @@ int expand_coremask(const char *coremask, int **cores, int *nr_cores)
|
|||||||
long v, needle;
|
long v, needle;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function returns array of usabe cores in `cores` and
|
* This function returns array of usable cores in `cores` and
|
||||||
* returns the number of usabel cores (array length) through
|
* returns the number of usable cores (array length) through
|
||||||
* nr_cores.
|
* nr_cores.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -214,6 +214,11 @@ int expand_coremask(const char *coremask, int **cores, int *nr_cores)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nr_usable < 1) {
|
||||||
|
pr_err("invalid core mask: %s\n", coremask);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
*cores = core_list;
|
*cores = core_list;
|
||||||
*nr_cores = nr_usable;
|
*nr_cores = nr_usable;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user