]> git.ipfire.org Git - thirdparty/linux.git/commit
mm/damon/sysfs-schemes: use kmalloc_array() and size_add()
authorSu Hui <suhui@nfschina.com>
Mon, 21 Apr 2025 06:24:24 +0000 (14:24 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 13 May 2025 06:50:45 +0000 (23:50 -0700)
commitee43f26b49e9ddad0f06c149085343613a9d73a4
tree620ca3824813710321c7636797d220b62531f43a
parent551c643fb29a221e8fcd00ff680a364a73deb2f3
mm/damon/sysfs-schemes: use kmalloc_array() and size_add()

It's safer to use kmalloc_array() and size_add() because it can prevent
possible overflow problem.

Link: https://lkml.kernel.org/r/20250421062423.740605-1-suhui@nfschina.com
Signed-off-by: Su Hui <suhui@nfschina.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/sysfs-schemes.c