]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/nouveau/gsp: fix potential leak of memory used during acpi init
authorBen Skeggs <bskeggs@nvidia.com>
Tue, 17 Jun 2025 04:00:36 +0000 (14:00 +1000)
committerDanilo Krummrich <dakr@kernel.org>
Mon, 7 Jul 2025 14:32:44 +0000 (16:32 +0200)
commitd133036a0b23d3ef781d067ccdea6bbfb381e0cf
tree49fe5f0690dba78ab473650cde45636b072913d2
parent3d44147494385b245f021a3a3a5c1408be1d50d1
drm/nouveau/gsp: fix potential leak of memory used during acpi init

If any of the ACPI calls fail, memory allocated for the input buffer
would be leaked.  Fix failure paths to free allocated memory.

Also add checks to ensure the allocations succeeded in the first place.

Reported-by: Danilo Krummrich <dakr@kernel.org>
Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM")
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20250617040036.2932-1-bskeggs@nvidia.com
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c