In damon_sysfs_kdamond_release(), we have use container_of() to get
"kdamond" pointer, so there no need to get it once again.
Link: https://lkml.kernel.org/r/20220303075314.22502-1-xhao@linux.alibaba.com
Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
if (kdamond->damon_ctx)
damon_destroy_ctx(kdamond->damon_ctx);
- kfree(container_of(kobj, struct damon_sysfs_kdamond, kobj));
+ kfree(kdamond);
}
static struct kobj_attribute damon_sysfs_kdamond_state_attr =