lkml.org 
[lkml]   [2021]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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?

\
 
 \ /
  Last update: 2021-12-14 18:04    [W:0.113 / U:2.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site