There's invalid reallocation of config_table variable in config_insert_cgroup() function.
Signed-off-by: Peter Schiffer <pschiffe@redhat.com>
Acked-by: Ivana Hutarova Varekova <varekova@redhat.com>
break;
default:
return 0;
- }
+ }
if (*table_index >= *max - 1) {
struct cgroup *newblk;
memset(newblk + oldlen, 0, (*max - oldlen) *
sizeof(struct cgroup));
init_cgroup_table(newblk + oldlen, *max - oldlen);
- config_cgroup_table = newblk;
+ config_table = newblk;
+ switch (flag) {
+ case CGROUP:
+ config_cgroup_table = config_table;
+ break;
+ case TEMPLATE:
+ config_template_table = config_table;
+ break;
+ default:
+ return 0;
+ }
cgroup_dbg("maximum %d\n", *max);
cgroup_dbg("reallocated config_table to %p\n",
config_table);