Skip to content

Commit 70b8480

Browse files
sjp38torvalds
authored andcommitted
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/[email protected] Link: https://lkml.kernel.org/r/[email protected] Fixes: 4bc0595 ("mm/damon: implement a debugfs-based user space interface") Signed-off-by: SeongJae Park <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 2cd4b8e commit 70b8480

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mm/damon/dbgfs.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ static ssize_t dbgfs_target_ids_write(struct file *file,
364364
struct damon_ctx *ctx = file->private_data;
365365
struct damon_target *t, *next_t;
366366
bool id_is_pid = true;
367-
char *kbuf, *nrs;
367+
char *kbuf;
368368
unsigned long *targets;
369369
ssize_t nr_targets;
370370
ssize_t ret;
@@ -374,14 +374,13 @@ static ssize_t dbgfs_target_ids_write(struct file *file,
374374
if (IS_ERR(kbuf))
375375
return PTR_ERR(kbuf);
376376

377-
nrs = kbuf;
378377
if (!strncmp(kbuf, "paddr\n", count)) {
379378
id_is_pid = false;
380379
/* target id is meaningless here, but we set it just for fun */
381380
scnprintf(kbuf, count, "42 ");
382381
}
383382

384-
targets = str_to_target_ids(nrs, count, &nr_targets);
383+
targets = str_to_target_ids(kbuf, count, &nr_targets);
385384
if (!targets) {
386385
ret = -ENOMEM;
387386
goto out;

0 commit comments

Comments
 (0)