]> git.ipfire.org Git - thirdparty/kernel/stable.git/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:57:19 +0000 (11:57 +0100)
commitd98f43ab71e59a2c4dc664238d94538b40fb35c8
treedf1f6bb3a735a300a8c6f4b17907619455274a6b
parentce82bfafd6f9d00dfe04fe7d5e6f380fcabfb5b3
cxl/hdm: Remove broken error path

[ Upstream commit 5d09c63f11f083707b60c8ea0bb420651c47740f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cxl/core/hdm.c
drivers/cxl/core/region.c