Linux CXL
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Dan Williams <dan.j.williams@intel.com>,
	Dan Carpenter <dan.carpenter@linaro.org>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Dave Jiang <dave.jiang@intel.com>,
	"Alison Schofield" <alison.schofield@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Terry Bowman <terry.bowman@amd.com>,
	Robert Richter <rrichter@amd.com>, <linux-cxl@vger.kernel.org>,
	<kernel-janitors@vger.kernel.org>
Subject: RE: [PATCH 2/2] cxl/hdm: add unlock on error path
Date: Tue, 31 Oct 2023 15:04:45 -0700	[thread overview]
Message-ID: <654179fde285b_360f729419@iweiny-mobl.notmuch> (raw)
In-Reply-To: <65416eecf55b_780ef29464@dwillia2-xfh.jf.intel.com.notmuch>

Dan Williams wrote:
> Dan Carpenter wrote:
> > This error path needs to call up_read(&cxl_dpa_rwsem).
> 
> This looks correct for what it is, but that error path is a "should
> never happen" situation. It would be better to just eliminate that
> possibility altogether...
> 
> -- >8 --
> Subject: cxl/hdm: Remove broken error path
> 
> From: Dan Williams <dan.j.williams@intel.com>
> 
> Dan reports that cxl_decoder_commit() potentially leaks a hold of
> cxl_dpa_rwsem. The potential error case is a "should" not happen
> scenario, turn it into a "can not" happen scenario by adding the error
> check to cxl_port_setup_targets() where other setting validation occurs.
> 
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: http://lore.kernel.org/r/63295673-5d63-4919-b851-3b06d48734c0@moroto.mountain
> Fixes: 176baefb2eb5 ("cxl/hdm: Commit decoder state to hardware")


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

  parent reply	other threads:[~2023-10-31 22:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-31  9:53 [PATCH 1/2] cxl/hdm: Fix && vs || bug Dan Carpenter
2023-10-31  9:54 ` [PATCH 2/2] cxl/hdm: add unlock on error path Dan Carpenter
2023-10-31 21:17   ` Dan Williams
2023-10-31 21:47     ` Dave Jiang
2023-10-31 22:04     ` Ira Weiny [this message]
2023-10-31 11:02 ` [PATCH 1/2] cxl/hdm: Fix && vs || bug Robert Richter

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=654179fde285b_360f729419@iweiny-mobl.notmuch \
    --to=ira.weiny@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.carpenter@linaro.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=jonathan.cameron@huawei.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=rrichter@amd.com \
    --cc=terry.bowman@amd.com \
    --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