linux/drivers/gpu/drm/nouveau/nvkm/subdev/acr
Wentao Liang c3027973f6 drm/nouveau/acr: fix missing nvkm_done() in error path of nvkm_acr_oneinit()
In nvkm_acr_oneinit(), nvkm_kmap(acr->wpr) is invoked unconditionally
at line 309 to obtain a mapping reference. Additionally, when both
acr->wpr_fw and acr->wpr_comp are present, a second nvkm_kmap() is
called inside the conditional block. Both mappings are expected to be
released by nvkm_done(acr->wpr) at line 320 before the function returns
successfully.

However, when a mismatch is detected during the loop within the
conditional block, the function returns -EINVAL at line 318 without
calling nvkm_done(). This results in a leak of the kmap reference(s)
acquired earlier.

Fix the issue by invoking nvkm_done(acr->wpr) prior to the early return
to ensure proper release of the mapping references.

Fixes: 22dcda45a3 ("drm/nouveau/acr: implement new subdev to replace "secure boot"")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20260606155606.77593-1-vulab@iscas.ac.cn
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-06-21 15:06:01 +02:00
..
base.c drm/nouveau/acr: fix missing nvkm_done() in error path of nvkm_acr_oneinit() 2026-06-21 15:06:01 +02:00
ga100.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ga102.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
gm20b.c drm/nouveau/acr: use common falcon HS FW code for ACR FWs 2022-11-09 10:44:58 +10:00
gm200.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
gp10b.c drm/nouveau/acr: use common falcon HS FW code for ACR FWs 2022-11-09 10:44:58 +10:00
gp102.c drm/nouveau/acr/ga102: initial support 2022-11-09 10:45:21 +10:00
gp108.c drm/nouveau/acr: use common falcon HS FW code for ACR FWs 2022-11-09 10:44:58 +10:00
gv100.c drm/nouveau/acr: use common falcon HS FW code for ACR FWs 2022-11-09 10:44:58 +10:00
Kbuild drm/nouveau/acr/ga102: initial support 2022-11-09 10:45:21 +10:00
lsfw.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
priv.h drm/nouveau/acr/ga102: initial support 2022-11-09 10:45:21 +10:00
tu102.c drm/nouveau/acr/tu102-: prepare for GSP-RM 2023-10-31 15:08:10 +10:00