diff options
author | Dan Williams <dan.j.williams@intel.com> | 2022-08-01 12:55:30 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2022-08-05 08:41:02 -0700 |
commit | e29a8995d63f6f861b2cc446c58cef430885f469 (patch) | |
tree | 984e4105a2d6429ea051ec551e20f86b38ac5192 /include/crypto/hmac.h | |
parent | 69c9961387f244077101de3ce4e272717617dc87 (diff) |
cxl/region: Fix region reference target accounting
Dan reports:
The error handling in cxl_port_attach_region() looks like it might
have a similar bug. The cxl_rr->nr_targets++; might want a --.
That function is more complicated.
Indeed cxl_rr->nr_targets leaks when cxl_rr_ep_add() fails, but that
flow is not clear. Fix the bug and the clarity by separating the 'new'
region-reference case from the 'extend' region-reference case. This also
moves the host-physical-address (HPA) validation, that the HPA of a new
region being accounted to the port is greater than the HPA of all other
regions associated with the port, to alloc_region_ref().
Introduce @nr_targets_inc to track when the error exit path needs to
clean up cxl_rr->nr_targets.
Fixes: 384e624bb211 ("cxl/region: Attach endpoint decoders")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Link: http://lore.kernel.org/r/165939482134.252363.1915691883146696327.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/crypto/hmac.h')
0 files changed, 0 insertions, 0 deletions