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

2023-06-20 Thread Alison Schofield
On Tue, Jun 20, 2023 at 07:33:32PM +0530, Tarun Sahu wrote: > memory_group_register_static takes maximum number of pages as the argument > while dev_dax_kmem_probe passes total_len (in bytes) as the argument. This sounds like a fix. An explanation of the impact and a fixes tag may be needed.

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

2023-06-20 Thread Ira Weiny
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 avoid > > memory leak. > > > > Fixes: 49bddc73d15c

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

2023-06-20 Thread Tarun Sahu
memory_group_register_static takes maximum number of pages as the argument while dev_dax_kmem_probe passes total_len (in bytes) as the argument. Signed-off-by: Tarun Sahu --- drivers/dax/kmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dax/kmem.c

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

2023-06-20 Thread Ira Weiny
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 avoid > memory leak. > > Fixes: 49bddc73d15c ("libnvdimm/of_pmem: Provide a unique

Re: [PATCH 3/3] dax/kmem: Always enroll hotplugged memory for memmap_on_memory

2023-06-20 Thread Tarun Sahu
Hi Vishal, Vishal Verma writes: > With DAX memory regions originating from CXL memory expanders or > NVDIMMs, the kmem driver may be hot-adding huge amounts of system memory > on a system without enough 'regular' main memory to support the memmap > for it. To avoid this, ensure that all kmem