From: Kenneth Lee Date: Mon, 8 Aug 2022 22:00:19 +0000 (-0700) Subject: mm/damon/dbgfs: use kmalloc for allocating only one element X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b2d4c646d5a15c1854e09898a374983167e53e0e;p=linux.git mm/damon/dbgfs: use kmalloc for allocating only one element Use kmalloc(...) rather than kmalloc_array(1, ...) because the number of elements we are specifying in this case is 1, kmalloc would accomplish the same thing and we can simplify. Link: https://lkml.kernel.org/r/20220808220019.1680469-1-klee33@uw.edu Signed-off-by: Kenneth Lee Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton --- diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c index cfdf63132d5ad..3b55a1b219b58 100644 --- a/mm/damon/dbgfs.c +++ b/mm/damon/dbgfs.c @@ -1044,7 +1044,7 @@ static int __init __damon_dbgfs_init(void) fops[i]); dbgfs_fill_ctx_dir(dbgfs_root, dbgfs_ctxs[0]); - dbgfs_dirs = kmalloc_array(1, sizeof(dbgfs_root), GFP_KERNEL); + dbgfs_dirs = kmalloc(sizeof(dbgfs_root), GFP_KERNEL); if (!dbgfs_dirs) { debugfs_remove(dbgfs_root); return -ENOMEM;