From: Miri Korenblit <miriam.rachel.korenblit@xxxxxxxxx> This was added in 6.3. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@xxxxxxxxx> Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx> --- backport/backport-include/linux/mm.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/backport/backport-include/linux/mm.h b/backport/backport-include/linux/mm.h index 46c7ecafce76..83b495a1bd02 100644 --- a/backport/backport-include/linux/mm.h +++ b/backport/backport-include/linux/mm.h @@ -10,5 +10,18 @@ static inline void *kvcalloc(size_t n, size_t size, gfp_t flags) return kvmalloc_array(n, size, flags | __GFP_ZERO); } #endif /* < 4.18 */ +#if LINUX_VERSION_IS_LESS(6,3,0) + +#define kvmemdup LINUX_BACKPORT(kvmemdup) +static inline void *kvmemdup(const void *src, size_t len, gfp_t gfp) +{ + void *p; + + p = kvmalloc(len, gfp); + if (p) + memcpy(p, src, len); + return p; +} +#endif #endif /* __BACKPORT_MM_H */ -- 2.45.1