diff options
| author | Wentao Liang <vulab@iscas.ac.cn> | 2026-04-08 15:45:34 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-07-04 13:44:20 +0200 |
| commit | 369496d885b4cf6e8647cf4dc5cf3ac68fdf37a1 (patch) | |
| tree | 912cfc08ebcb1293438a4c4174ab41bb931addb5 | |
| parent | b3a3831b2eb884641906fc5e46207b205b6aea13 (diff) | |
| download | linux-stable-369496d885b4cf6e8647cf4dc5cf3ac68fdf37a1.tar.gz linux-stable-369496d885b4cf6e8647cf4dc5cf3ac68fdf37a1.zip | |
fpga: region: fix use-after-free in child_regions_with_firmware()
commit 54f3c5643ec523a04b6ec0e7c19eb10f5ebebdd3 upstream.
Move of_node_put(child_region) after the error print to avoid accessing
freed memory when pr_err() references child_region.
Fixes: 0fa20cdfcc1f ("fpga: fpga-region: device tree control for FPGA")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
[ Yilun: Fix the Fixes tag ]
Reviewed-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20260408154534.404327-1-vulab@iscas.ac.cn
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/fpga/of-fpga-region.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c index caa091224dc5..9107a5b461d3 100644 --- a/drivers/fpga/of-fpga-region.c +++ b/drivers/fpga/of-fpga-region.c @@ -168,11 +168,10 @@ static int child_regions_with_firmware(struct device_node *overlay) fpga_region_of_match); } - of_node_put(child_region); - if (ret) pr_err("firmware-name not allowed in child FPGA region: %pOF", child_region); + of_node_put(child_region); return ret; } |
