Messages in this thread | ![/](/images/icornerl.gif) | | Date | Tue, 14 Dec 2021 18:03:52 +0100 | From | Michal Koutný <> | Subject | Re: [PATCH 2/6] cgroup: Allocate cgroup_file_ctx for kernfs_open_file->priv |
| |
On Mon, Dec 13, 2021 at 09:18:29AM -1000, Tejun Heo <tj@kernel.org> wrote: > static int cgroup_file_open(struct kernfs_open_file *of)
IIUC, this is common to v1 files too, i.e. cgroup_pidlist_start too.
> static void cgroup_file_release(struct kernfs_open_file *of) > { > struct cftype *cft = of_cft(of); > + struct cgroup_file_ctx *ctx = of->priv; > > if (cft->release) > cft->release(of); > + kfree(ctx);
Here it could free a pointer to pidlist that has different lifecycle.
Perhaps add one more slot into cgroup_file_ctx for the pidlist pointer?
| ![\](/images/icornerr.gif) |