[PATCH v2] nvdimm: of_pmem: Check return value and add kfree for kstrdup

2023-08-28 Thread Chen Ni
Check the return value of kstrdup() and add kfree() for kstrdup() to avoid memory leak. Fixes: 49bddc73d15c ("libnvdimm/of_pmem: Provide a unique name for bus provider") Signed-off-by: Chen Ni --- Changelog: v1 -> v2: 1.Add a fixes tag. 2.Update commit message. --- drivers/nvdimm/of_pmem.c

Re: [PATCH] nvdimm: of_pmem: Add kfree for kstrdup

2023-08-28 Thread Dave Jiang
On 8/27/23 23:23, Chen Ni wrote: Add kfree() for kstrdup() in order to avoid memory leak. Signed-off-by: Chen Ni Can you please add a fixes tag? Thanks! --- drivers/nvdimm/of_pmem.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/nvdimm/of_pmem.c

[PATCH] nvdimm: of_pmem: Add kfree for kstrdup

2023-08-28 Thread Chen Ni
Add kfree() for kstrdup() in order to avoid memory leak. Signed-off-by: Chen Ni --- drivers/nvdimm/of_pmem.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/nvdimm/of_pmem.c b/drivers/nvdimm/of_pmem.c index 10dbdcdfb9ce..fe6edb7e6631 100644 --- a/drivers/nvdimm/of_pmem.c +++