e29a8995d6
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:
|
||
---|---|---|
.. | ||
core | ||
acpi.c | ||
cxl.h | ||
cxlmem.h | ||
cxlpci.h | ||
Kconfig | ||
Makefile | ||
mem.c | ||
pci.c | ||
pmem.c | ||
port.c |