[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20231025051922.525940-1-suhui@nfschina.com>
Date: Wed, 25 Oct 2023 13:19:23 +0800
From: Su Hui <suhui@...china.com>
To: kherbst@...hat.com, lyude@...hat.com, dakr@...hat.com,
airlied@...il.com, daniel@...ll.ch
Cc: Su Hui <suhui@...china.com>, airlied@...hat.com,
dri-devel@...ts.freedesktop.org, nouveau@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH] drm/nouveau/nvif: avoid possible memory leak of 'args'
Use kfree() to free 'args' before return '-EINVAL'.
Signed-off-by: Su Hui <suhui@...china.com>
---
drivers/gpu/drm/nouveau/nvif/vmm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/nouveau/nvif/vmm.c b/drivers/gpu/drm/nouveau/nvif/vmm.c
index 99296f03371a..a0afe3bf0d78 100644
--- a/drivers/gpu/drm/nouveau/nvif/vmm.c
+++ b/drivers/gpu/drm/nouveau/nvif/vmm.c
@@ -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;
}
--
2.30.2
Powered by blists - more mailing lists