9b4eee8572
[ Upstream commit b7c0e1ecee403a43abc89eb3e75672b01ff2ece9 ]
The current implementation of the fpga region assumes that the low-level
module registers a driver for the parent device and uses its owner pointer
to take the module's refcount. This approach is problematic since it can
lead to a null pointer dereference while attempting to get the region
during programming if the parent device does not have a driver.
To address this problem, add a module owner pointer to the fpga_region
struct and use it to take the module's refcount. Modify the functions for
registering a region to take an additional owner module parameter and
rename them to avoid conflicts. Use the old function names for helper
macros that automatically set the module that registers the region as the
owner. This ensures compatibility with existing low-level control modules
and reduces the chances of registering a region without setting the owner.
Also, update the documentation to keep it consistent with the new interface
for registering an fpga region.
Fixes:
|
||
---|---|---|
.. | ||
Kconfig | ||
Makefile | ||
altera-cvp.c | ||
altera-fpga2sdram.c | ||
altera-freeze-bridge.c | ||
altera-hps2fpga.c | ||
altera-pr-ip-core-plat.c | ||
altera-pr-ip-core.c | ||
altera-ps-spi.c | ||
dfl-afu-dma-region.c | ||
dfl-afu-error.c | ||
dfl-afu-main.c | ||
dfl-afu-region.c | ||
dfl-afu.h | ||
dfl-fme-br.c | ||
dfl-fme-error.c | ||
dfl-fme-main.c | ||
dfl-fme-mgr.c | ||
dfl-fme-perf.c | ||
dfl-fme-pr.c | ||
dfl-fme-pr.h | ||
dfl-fme-region.c | ||
dfl-fme.h | ||
dfl-n3000-nios.c | ||
dfl-pci.c | ||
dfl.c | ||
dfl.h | ||
fpga-bridge.c | ||
fpga-mgr.c | ||
fpga-region.c | ||
ice40-spi.c | ||
machxo2-spi.c | ||
of-fpga-region.c | ||
socfpga-a10.c | ||
socfpga.c | ||
stratix10-soc.c | ||
ts73xx-fpga.c | ||
versal-fpga.c | ||
xilinx-pr-decoupler.c | ||
xilinx-spi.c | ||
zynq-fpga.c | ||
zynqmp-fpga.c |