[PATCH] libnvdimm/of_pmem: Replace kstrdup with devm_kstrdup and add check

2023-06-22 Thread Jiasheng Jiang
Replace kstrdup() with devm_kstrdup() to avoid memory leak and add check for the return value of the devm_kstrdup() to avoid NULL pointer dereference Fixes: 49bddc73d15c ("libnvdimm/of_pmem: Provide a unique name for bus provider") Signed-off-by: Jiasheng Jiang --- drivers/nvdimm/of_pmem.c | 7

Re: [PATCH] libnvdimm/of_pmem: Add check and kfree for kstrdup

2023-06-22 Thread Jiasheng Jiang
On Wed, Jun 21, 2023 at 00:04:36 +0800, Ira Weiny wrote: > Ira Weiny wrote: >> Jiasheng Jiang wrote: >> > Add check for the return value of kstrdup() and return the error >> > if it fails in order to avoid NULL pointer dereference. >> > Moreover, use kfree() in the later error handling in order to

Re: [PATCH 0/3] mm: use memmap_on_memory semantics for dax/kmem

2023-06-22 Thread David Hildenbrand
On 21.06.23 21:32, Verma, Vishal L wrote: On Fri, 2023-06-16 at 09:44 +0200, David Hildenbrand wrote: On 16.06.23 00:00, Vishal Verma wrote: The dax/kmem driver can potentially hot-add large amounts of memory originating from CXL memory expanders, or NVDIMMs, or other 'device memories'. There

Re: [PATCH 1/3] mm/memory_hotplug: Allow an override for the memmap_on_memory param

2023-06-22 Thread Jonathan Cameron
On Fri, 16 Jun 2023 09:46:59 +0200 David Hildenbrand wrote: > On 16.06.23 00:00, Vishal Verma wrote: > > For memory hotplug to consider MHP_MEMMAP_ON_MEMORY behavior, the > > 'memmap_on_memory' module parameter was a hard requirement. > > > > In preparation for the dax/kmem driver to use

Re: [PATCH] dax/kmem: Pass valid argument to memory_group_register_static

2023-06-22 Thread Tarun Sahu
Hi Vishal, "Verma, Vishal L" writes: > On Wed, 2023-06-21 at 11:36 +0530, Tarun Sahu wrote: >> Hi Alison, >> >> Alison Schofield writes: >> >> > On Tue, Jun 20, 2023 at 07:33:32PM +0530, Tarun Sahu wrote: >> > > memory_group_register_static takes maximum number of pages as the >> > >