summaryrefslogtreecommitdiffstats
path: root/mm/init-mm.c
diff options
context:
space:
mode:
authorBarry Song <song.bao.hua@hisilicon.com>2020-08-12 03:31:57 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2020-08-12 19:57:57 +0200
commit18e98e56f4407b8c766b6f6d9f2850fd2a081e4d (patch)
tree9ddb1fef5f305dcca449ed76a8c2389d00353f9f /mm/init-mm.c
parentmm/cma.c: fix NULL pointer dereference when cma could not be activated (diff)
downloadlinux-18e98e56f4407b8c766b6f6d9f2850fd2a081e4d.tar.xz
linux-18e98e56f4407b8c766b6f6d9f2850fd2a081e4d.zip
mm: cma: fix the name of CMA areas
Patch series "mm: fix the names of general cma and hugetlb cma", v2. The current code of CMA can only work when users pass a const string as name parameter. we need to fix the way to handle names in CMA. On the other hand, to avoid name conflicts after enabling CMA_DEBUGFS, each hugetlb should get a different CMA name. This patch (of 2): If users give a name saved in stack, the current code will generate magic pointer. if users don't give a name(NULL), kasprintf() will always return NULL as we are at the early stage. that means cma_init_reserved_mem() will return -ENOMEM if users set name parameter as NULL. [natechancellor@gmail.com: return cma->name directly in cma_get_name] Link: https://github.com/ClangBuiltLinux/linux/issues/1063 Link: http://lkml.kernel.org/r/20200623015840.621964-1-natechancellor@gmail.com Signed-off-by: Barry Song <song.bao.hua@hisilicon.com> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com> Acked-by: Roman Gushchin <guro@fb.com> Link: http://lkml.kernel.org/r/20200616223131.33828-2-song.bao.hua@hisilicon.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/init-mm.c')
0 files changed, 0 insertions, 0 deletions