]> git.itanic.dy.fi Git - linux-stable/commit
cxl/hdm: Remove broken error path
authorDan Williams <dan.j.williams@intel.com>
Tue, 31 Oct 2023 21:09:19 +0000 (14:09 -0700)
committerDan Williams <dan.j.williams@intel.com>
Tue, 31 Oct 2023 21:10:04 +0000 (14:10 -0700)
commit5d09c63f11f083707b60c8ea0bb420651c47740f
treed7709fb9c23eccf9a3b00bbf1bd3489e04afdf6a
parent69d56b15a7941680aba8c3175b165221ecdf54b6
cxl/hdm: Remove broken error path

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
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Fixes: 176baefb2eb5 ("cxl/hdm: Commit decoder state to hardware")
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/hdm.c
drivers/cxl/core/region.c