mm/util: Introduce kmemdup_array()
authorKartik <kkartik@nvidia.com>
Tue, 17 Oct 2023 05:23:15 +0000 (10:53 +0530)
committerThierry Reding <treding@nvidia.com>
Thu, 1 Feb 2024 14:58:05 +0000 (15:58 +0100)
commit7092e9b3bed1252c7d3f5812b9fb9d82375b73a6
treef394199a150ef9400a8967586a481d87e4e14768
parent9863084dd9939e53eb67a689f13503e8025434ac
mm/util: Introduce kmemdup_array()

Introduce kmemdup_array() API to duplicate `n` number of elements
from a given array. This internally uses kmemdup to allocate and duplicate
the `src` array.

Signed-off-by: Kartik <kkartik@nvidia.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
include/linux/string.h
mm/util.c