[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZjF2_0epRVOrgtV-@debian>
Date: Tue, 30 Apr 2024 15:55:59 -0700
From: fan <nifan.cxl@...il.com>
To: Li Zhijian <lizhijian@...itsu.com>
Cc: dave@...olabs.net, jonathan.cameron@...wei.com, dave.jiang@...el.com,
alison.schofield@...el.com, vishal.l.verma@...el.com,
ira.weiny@...el.com, dan.j.williams@...el.com,
linux-cxl@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cxl/region: Fix cxlr_pmem leaks
On Sun, Apr 28, 2024 at 11:07:48AM +0800, Li Zhijian wrote:
> Before this error path, cxlr_pmem pointed to a kzalloc() memory, free
> it to avoid this memory leaking.
>
> Fixes: f17b558d6663 ("cxl/pmem: Refactor nvdimm device registration, delete the workqueue")
> Signed-off-by: Li Zhijian <lizhijian@...itsu.com>
> ---
Reviewed-by: Fan Ni <fan.ni@...sung.com>
> drivers/cxl/core/region.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index 5c186e0a39b9..812b2948b6c6 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -2719,6 +2719,7 @@ static struct cxl_pmem_region *cxl_pmem_region_alloc(struct cxl_region *cxlr)
> if (i == 0) {
> cxl_nvb = cxl_find_nvdimm_bridge(cxlmd);
> if (!cxl_nvb) {
> + kfree(cxlr_pmem);
> cxlr_pmem = ERR_PTR(-ENODEV);
> goto out;
> }
> --
> 2.29.2
>
Powered by blists - more mailing lists