Skip to contentSkip to conversation

drm/nouveau/nvif: avoid possible memory leak of 'args'

PATCH New Su Hui 1 participant 1 message Oct 25, 2023

Subsystems (4)
lore
Share & tools
lore

Su Hui

author
#0 lore raw

PATCH 1/1 drm/nouveau/nvif: avoid possible memory leak of 'args'

Use kfree() to free 'args' before return '-EINVAL'.

---
 drivers/gpu/drm/nouveau/nvif/vmm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/nouveau/nvif/vmm.c +1 -0
index 99296f03371a..a0afe3bf0d78 100644
@@ -219,6 +219,7 @@ nvif_vmm_ctor(struct nvif_mmu *mmu, const char *name, s32 oclass,
 	case RAW: args->type = NVIF_VMM_V0_TYPE_RAW; break;
 	default:
 		WARN_ON(1);
+		kfree(args);
 		return -EINVAL;
 	}
 
Signature · 1 line
2.30.2