memcg, kmem: fix reference count handling on the error path
[platform/adaptation/renesas_rcar/renesas_kernel.git] / mm / memcontrol.c
index 6b73d86..bdeb82c 100644 (file)
@@ -6345,14 +6345,6 @@ mem_cgroup_css_online(struct cgroup *cont)
 
        error = memcg_init_kmem(memcg, &mem_cgroup_subsys);
        mutex_unlock(&memcg_create_mutex);
-       if (error) {
-               /*
-                * We call put now because our (and parent's) refcnts
-                * are already in place. mem_cgroup_put() will internally
-                * call __mem_cgroup_free, so return directly
-                */
-               mem_cgroup_put(memcg);
-       }
        return error;
 }