free cpu_ban_string when the next request come
This commit is contained in:
parent
4d02672c30
commit
0fab11043a
|
@ -118,10 +118,6 @@ static void setup_banned_cpus(void)
|
||||||
if (cpu_ban_string != NULL && banned_cpumask_from_ui != NULL) {
|
if (cpu_ban_string != NULL && banned_cpumask_from_ui != NULL) {
|
||||||
cpulist_parse(banned_cpumask_from_ui,
|
cpulist_parse(banned_cpumask_from_ui,
|
||||||
strlen(banned_cpumask_from_ui), banned_cpus);
|
strlen(banned_cpumask_from_ui), banned_cpus);
|
||||||
/* release it safety, it was allocated in sock_handle */
|
|
||||||
free(cpu_ban_string);
|
|
||||||
cpu_ban_string = NULL;
|
|
||||||
banned_cpumask_from_ui = NULL;
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (getenv("IRQBALANCE_BANNED_CPUS")) {
|
if (getenv("IRQBALANCE_BANNED_CPUS")) {
|
||||||
|
|
19
irqbalance.c
19
irqbalance.c
|
@ -471,12 +471,9 @@ gboolean sock_handle(gint fd, GIOCondition condition, gpointer user_data __attri
|
||||||
free(irq_string);
|
free(irq_string);
|
||||||
} else if (!(strncmp(buff + strlen("settings "), "cpus ",
|
} else if (!(strncmp(buff + strlen("settings "), "cpus ",
|
||||||
strlen("cpus")))) {
|
strlen("cpus")))) {
|
||||||
/*
|
banned_cpumask_from_ui = NULL;
|
||||||
* if cpu_ban_string has not been consumed,
|
free(cpu_ban_string);
|
||||||
* just ignore this request.
|
cpu_ban_string = NULL;
|
||||||
*/
|
|
||||||
if (cpu_ban_string != NULL)
|
|
||||||
goto out_close;
|
|
||||||
|
|
||||||
cpu_ban_string = malloc(
|
cpu_ban_string = malloc(
|
||||||
sizeof(char) * (recv_size - strlen("settings cpus ")));
|
sizeof(char) * (recv_size - strlen("settings cpus ")));
|
||||||
|
@ -489,15 +486,9 @@ gboolean sock_handle(gint fd, GIOCondition condition, gpointer user_data __attri
|
||||||
if (!strncmp(banned_cpumask_from_ui, "NULL", strlen("NULL"))) {
|
if (!strncmp(banned_cpumask_from_ui, "NULL", strlen("NULL"))) {
|
||||||
banned_cpumask_from_ui = NULL;
|
banned_cpumask_from_ui = NULL;
|
||||||
free(cpu_ban_string);
|
free(cpu_ban_string);
|
||||||
cpu_ban_string = NULL;;
|
cpu_ban_string = NULL;
|
||||||
} else {
|
|
||||||
/*
|
|
||||||
* don't free cpu_ban_string at here, it will be
|
|
||||||
* released after we have store it to @banned_cpus
|
|
||||||
* in setup_banned_cpus function.
|
|
||||||
*/
|
|
||||||
need_rescan = 1;
|
|
||||||
}
|
}
|
||||||
|
need_rescan = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!strncmp(buff, "setup", strlen("setup"))) {
|
if (!strncmp(buff, "setup", strlen("setup"))) {
|
||||||
|
|
Loading…
Reference in a new issue