From: jsg Date: Mon, 29 Jan 2024 01:44:25 +0000 (+0000) Subject: gpu/drm/radeon: fix two memleaks in radeon_vm_init X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f3a4ca4a9e5e8e842f3d1b99894d7cca60c2b47a;p=openbsd gpu/drm/radeon: fix two memleaks in radeon_vm_init From Zhipeng Lu 4c9a96dd6d4acaa18146f5b1de457fec1004628c in linux-6.6.y/6.6.14 c2709b2d6a537ca0fa0f1da36fdaf07e48ef447d in mainline linux --- diff --git a/sys/dev/pci/drm/radeon/radeon_vm.c b/sys/dev/pci/drm/radeon/radeon_vm.c index 13006f57752..5ffd331ddfb 100644 --- a/sys/dev/pci/drm/radeon/radeon_vm.c +++ b/sys/dev/pci/drm/radeon/radeon_vm.c @@ -1204,13 +1204,17 @@ int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm) r = radeon_bo_create(rdev, pd_size, align, true, RADEON_GEM_DOMAIN_VRAM, 0, NULL, NULL, &vm->page_directory); - if (r) + if (r) { + kfree(vm->page_tables); + vm->page_tables = NULL; return r; - + } r = radeon_vm_clear_bo(rdev, vm->page_directory); if (r) { radeon_bo_unref(&vm->page_directory); vm->page_directory = NULL; + kfree(vm->page_tables); + vm->page_tables = NULL; return r; }