Linux CXL
 help / color / mirror / Atom feed
* Re: [PATCH] libcxl: Fix memory leakage in cxl_port_init()
       [not found] <165813258358.95191.6678871197554236554.stgit@LAPTOP-TBQTPII8>
@ 2022-07-19  7:36 ` Verma, Vishal L
  0 siblings, 0 replies; only message in thread
From: Verma, Vishal L @ 2022-07-19  7:36 UTC (permalink / raw)
  To: sbhat@linux.ibm.com, nvdimm@lists.linux.dev
  Cc: Williams, Dan J, aneesh.kumar@linux.ibm.com,
	linux-cxl@vger.kernel.org, vaibhav@linux.ibm.com

On Mon, 2022-07-18 at 13:53 +0530, Shivaprasad G Bhat wrote:
> The local variable 'path' is not freed in cxl_port_init() for success
> case.
> The patch fixes that.
> 
> Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
> ---
>  cxl/lib/libcxl.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/cxl/lib/libcxl.c b/cxl/lib/libcxl.c
> index be6bc2c..e52896f 100644
> --- a/cxl/lib/libcxl.c
> +++ b/cxl/lib/libcxl.c
> @@ -770,6 +770,7 @@ static int cxl_port_init(struct cxl_port *port,
> struct cxl_port *parent_port,
>         if (sysfs_read_attr(ctx, path, buf) == 0)
>                 port->module = util_modalias_to_module(ctx, buf);
>  
> +       free(path);
>         return 0;
>  err:
>         free(port->dev_path);
> 
> 

Thanks, applied.
Just a quick note to CC linux-cxl@vger.kernel.org for CXL related
patches, and use "ndctl PATCH" as the subject prefix.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-19  7:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <165813258358.95191.6678871197554236554.stgit@LAPTOP-TBQTPII8>
2022-07-19  7:36 ` [PATCH] libcxl: Fix memory leakage in cxl_port_init() Verma, Vishal L

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox