public inbox for linux-cxl@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: jonathan.cameron@huawei.com, alison.schofield@intel.com,
	vishal.l.verma@intel.com, ira.weiny@intel.com,
	dan.j.williams@intel.com, linux-cxl@vger.kernel.org
Subject: Re: [PATCH] cxl/region: Fix leakage in __construct_region()
Date: Wed, 4 Mar 2026 10:28:29 -0700	[thread overview]
Message-ID: <37d5e8ee-8a1f-4382-acc7-34c75e1cb6dd@intel.com> (raw)
In-Reply-To: <20260202191330.245608-1-dave@stgolabs.net>



On 2/2/26 12:13 PM, Davidlohr Bueso wrote:
> Failing the first sysfs_update_group() needs to explicitly
> kfree the resource as it is too early for cxl_region_iomem_release()
> to do so.
> 
> Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>

Applied to cxl/fixes
77b310bb7b5ff8c017524df83292e0242ba89791

> ---
>  drivers/cxl/core/region.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index 96888d87a8df..28d70497283d 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -3795,8 +3795,10 @@ static int __construct_region(struct cxl_region *cxlr,
>  	}
>  
>  	rc = sysfs_update_group(&cxlr->dev.kobj, &cxl_region_group);
> -	if (rc)
> +	if (rc) {
> +		kfree(res);
>  		return rc;
> +	}
>  
>  	rc = insert_resource(cxlrd->res, res);
>  	if (rc) {


      parent reply	other threads:[~2026-03-04 17:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02 19:13 [PATCH] cxl/region: Fix leakage in __construct_region() Davidlohr Bueso
2026-02-02 19:16 ` Davidlohr Bueso
2026-02-02 19:24 ` Gregory Price
2026-02-02 22:00 ` Alison Schofield
2026-02-09 18:58   ` Davidlohr Bueso
2026-02-09 19:39 ` Ira Weiny
2026-02-09 19:52   ` Davidlohr Bueso
2026-03-04 17:14 ` Davidlohr Bueso
2026-03-04 17:28 ` Dave Jiang [this message]

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=37d5e8ee-8a1f-4382-acc7-34c75e1cb6dd@intel.com \
    --to=dave.jiang@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=vishal.l.verma@intel.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