diff options
author | Dan Williams <dan.j.williams@intel.com> | 2022-12-01 14:03:24 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-07 11:11:39 +0100 |
commit | b8b9b0b857b948e52b6d871d47ab9ef74d0cbee7 (patch) | |
tree | 7b8dc9272404b947f251f65acc0bc3a6f4b045f0 | |
parent | 833cdf903d2eed6a34ac1ffdc76d40534d0afccf (diff) | |
download | linux-stable-b8b9b0b857b948e52b6d871d47ab9ef74d0cbee7.tar.gz linux-stable-b8b9b0b857b948e52b6d871d47ab9ef74d0cbee7.tar.bz2 linux-stable-b8b9b0b857b948e52b6d871d47ab9ef74d0cbee7.zip |
cxl/region: Fix missing probe failure
commit bf3e5da8cb43a671b32fc125fa81b8f6a3677192 upstream.
cxl_region_probe() allows for regions not in the 'commit' state to be
enabled. Fail probe when the region is not committed otherwise the
kernel may indicate that an address range is active when none of the
decoders are active.
Fixes: 8d48817df6ac ("cxl/region: Add region driver boiler plate")
Cc: <stable@vger.kernel.org>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/166993220462.1995348.1698008475198427361.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/cxl/core/region.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index c7152b4bd9eb..c4f32c32dfd5 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -1923,6 +1923,9 @@ static int cxl_region_probe(struct device *dev) */ up_read(&cxl_region_rwsem); + if (rc) + return rc; + switch (cxlr->mode) { case CXL_DECODER_PMEM: return devm_cxl_add_pmem_region(cxlr); |