Skip to content

Commit b47c014

Browse files
committed
cxl/region: Fix cxlr_pmem leaks
jira LE-1907 cve CVE-2024-38391 Rebuild_History Non-Buildable kernel-5.14.0-427.31.1.el9_4 commit-author Li Zhijian <lizhijian@fujitsu.com> commit 1c987cf Before this error path, cxlr_pmem pointed to a kzalloc() memory, free it to avoid this memory leaking. Fixes: f17b558 ("cxl/pmem: Refactor nvdimm device registration, delete the workqueue") Signed-off-by: Li Zhijian <lizhijian@fujitsu.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20240428030748.318985-1-lizhijian@fujitsu.com Signed-off-by: Dave Jiang <dave.jiang@intel.com> (cherry picked from commit 1c987cf) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 1a97edc commit b47c014

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/cxl/core/region.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,6 +2279,7 @@ static struct cxl_pmem_region *cxl_pmem_region_alloc(struct cxl_region *cxlr)
22792279
if (i == 0) {
22802280
cxl_nvb = cxl_find_nvdimm_bridge(cxlmd);
22812281
if (!cxl_nvb) {
2282+
kfree(cxlr_pmem);
22822283
cxlr_pmem = ERR_PTR(-ENODEV);
22832284
goto out;
22842285
}

0 commit comments

Comments
 (0)