]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cxl/hdm: Fix potential infinite loop in __cxl_dpa_reserve()
authorLi Ming <ming.li@zohomail.com>
Mon, 12 Jan 2026 12:05:26 +0000 (20:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Jan 2026 10:21:17 +0000 (11:21 +0100)
commit1b3ed6c512cfd49a46977eccd82c5cc1add0e626
tree83dc3c6a5d78275dec6b657679a62b24ea3c3731
parent6cb008f1bb23e023dfe615cca5df14570dfc8da5
cxl/hdm: Fix potential infinite loop in __cxl_dpa_reserve()

[ Upstream commit d4026a44626490dc4eca4dd2c4d0816338fa179b ]

In __cxl_dpa_reserve(), it will check if the new resource range is
included in one of paritions of the cxl memory device.
cxlds->nr_paritions is used to represent how many partitions information
the cxl memory device has. In the loop, if driver cannot find a
partition including the new resource range, it will be an infinite loop.

[ dj: Removed incorrect fixes tag ]

Fixes: 991d98f17d31 ("cxl: Make cxl_dpa_alloc() DPA partition number agnostic")
Signed-off-by: Li Ming <ming.li@zohomail.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20260112120526.530232-1-ming.li@zohomail.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cxl/core/hdm.c