Linux CXL
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Dave Jiang <dave.jiang@intel.com>, <linux-cxl@vger.kernel.org>
Cc: <dan.j.williams@intel.com>, <ira.weiny@intel.com>,
	<vishal.l.verma@intel.com>, <alison.schofield@intel.com>,
	<Jonathan.Cameron@huawei.com>, <dave@stgolabs.net>
Subject: Re: [PATCH] cxl: Fix unregister_region() callback parameter assignment
Date: Thu, 14 Dec 2023 13:25:30 -0800	[thread overview]
Message-ID: <657b72cac2ec9_27c4df29484@iweiny-mobl.notmuch> (raw)
In-Reply-To: <170258123810.952211.3907381447996426480.stgit@djiang5-mobl3>

Dave Jiang wrote:
> In devm_cxl_add_region(), devm_add_action_or_reset() is called by passing
> in unregister_region() with data ptr of 'cxlr'. However, in
> unregister_region(), the passed in parameter is incorrectly assumed to be
> a 'struct device' rather than the 'cxlr' pointer. The code has been
> working because 'struct device' is the first member of 'struct
> cxl_region'. Issue found by inspection. Fix the assignment so that cxlr is
> pointing directly to the passed in parameter.
> 
> Fixes: 23a22cd1c98b ("cxl/region: Allocate HPA capacity to regions")

Technically I think the essence of the bug existed in 

Fixes: 779dd20cfb56 ("cxl/region: Add region creation support") 

...because the region pointer was used as a device there too.

Other than that:

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  drivers/cxl/core/region.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

[snip]

  reply	other threads:[~2023-12-14 21:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-14 19:13 [PATCH] cxl: Fix unregister_region() callback parameter assignment Dave Jiang
2023-12-14 21:25 ` Ira Weiny [this message]
2023-12-14 22:27   ` Dan Williams
2023-12-14 22:39     ` Ira Weiny

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=657b72cac2ec9_27c4df29484@iweiny-mobl.notmuch \
    --to=ira.weiny@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --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