UPSTREAM: mm/damon/dbgfs: remove an unnecessary variable
Patch series "mm/damon: Hide unnecessary information disclosures".
DAMON is exposing some unnecessary information including kernel pointer
in kernel log and tracepoint. This patchset hides such information.
The first patch is only for a trivial cleanup, though.
This patch (of 4):
This commit removes a unnecessarily used variable in
dbgfs_target_ids_write().
Link: https://lkml.kernel.org/r/20211229131016.23641-1-sj@kernel.org
Link: https://lkml.kernel.org/r/20211229131016.23641-2-sj@kernel.org
Fixes: 4bc05954d0
("mm/damon: implement a debugfs-based user space interface")
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 70b8480812d0a3930049a44820a1fa149b090c10)
Bug: 228223814
Signed-off-by: zhijun wan <wanzhijun@oppo.com>
Change-Id: I774c900de92780ae9ebf09f01c0b0536eb43f822
This commit is contained in:
parent
2861a7ee7f
commit
2d1227b126
|
@ -364,7 +364,7 @@ static ssize_t dbgfs_target_ids_write(struct file *file,
|
|||
struct damon_ctx *ctx = file->private_data;
|
||||
struct damon_target *t, *next_t;
|
||||
bool id_is_pid = true;
|
||||
char *kbuf, *nrs;
|
||||
char *kbuf;
|
||||
unsigned long *targets;
|
||||
ssize_t nr_targets;
|
||||
ssize_t ret;
|
||||
|
@ -374,14 +374,13 @@ static ssize_t dbgfs_target_ids_write(struct file *file,
|
|||
if (IS_ERR(kbuf))
|
||||
return PTR_ERR(kbuf);
|
||||
|
||||
nrs = kbuf;
|
||||
if (!strncmp(kbuf, "paddr\n", count)) {
|
||||
id_is_pid = false;
|
||||
/* target id is meaningless here, but we set it just for fun */
|
||||
scnprintf(kbuf, count, "42 ");
|
||||
}
|
||||
|
||||
targets = str_to_target_ids(nrs, count, &nr_targets);
|
||||
targets = str_to_target_ids(kbuf, count, &nr_targets);
|
||||
if (!targets) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
|
|
Loading…
Reference in New Issue