Linux CXL
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "sbhat@linux.ibm.com" <sbhat@linux.ibm.com>,
	"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>
Cc: "Williams, Dan J" <dan.j.williams@intel.com>,
	"aneesh.kumar@linux.ibm.com" <aneesh.kumar@linux.ibm.com>,
	"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
	"vaibhav@linux.ibm.com" <vaibhav@linux.ibm.com>
Subject: Re: [PATCH] libcxl: Fix memory leakage in cxl_port_init()
Date: Tue, 19 Jul 2022 07:36:58 +0000	[thread overview]
Message-ID: <e53d71edb94c38b67b53f12b7e6f1b7068c2b3ea.camel@intel.com> (raw)
In-Reply-To: <165813258358.95191.6678871197554236554.stgit@LAPTOP-TBQTPII8>

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.

           reply	other threads:[~2022-07-19  7:38 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <165813258358.95191.6678871197554236554.stgit@LAPTOP-TBQTPII8>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e53d71edb94c38b67b53f12b7e6f1b7068c2b3ea.camel@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=sbhat@linux.ibm.com \
    --cc=vaibhav@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox