mm/cma_debug.c: align the name buffer length as struct cma
authorKassey Li <quic_yingangl@quicinc.com>
Tue, 19 Jul 2022 09:15:54 +0000 (17:15 +0800)
committerakpm <akpm@linux-foundation.org>
Sat, 30 Jul 2022 01:07:16 +0000 (18:07 -0700)
Avoids truncating the debugfs output to 16 chars.  Potentially alters
the userspace output, but this is a debugfs interface and there are no
stability guarantees.

Link: https://lkml.kernel.org/r/20220719091554.27864-1-quic_yingangl@quicinc.com
Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
Cc: Sasha Levin <sashal@kernel.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/cma_debug.c

index 2e77049..c3ffe25 100644 (file)
@@ -163,7 +163,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(cma_alloc_fops, NULL, cma_alloc_write, "%llu\n");
 static void cma_debugfs_add_one(struct cma *cma, struct dentry *root_dentry)
 {
        struct dentry *tmp;
-       char name[16];
+       char name[CMA_MAX_NAME];
 
        scnprintf(name, sizeof(name), "cma-%s", cma->name);