From: Gustavo A. R. Silva Date: Tue, 24 Jul 2018 13:27:19 +0000 (-0500) Subject: drm/nouveau/secboot/acr: fix memory leak X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=74a07c0a59fa372b069d879971ba4d9e341979cf;p=openwrt%2Fstaging%2Fblogic.git drm/nouveau/secboot/acr: fix memory leak In case memory resources for *bl_desc* were allocated, release them before return. Addresses-Coverity-ID: 1472021 ("Resource leak") Fixes: 0d466901552a ("drm/nouveau/secboot/acr: Remove VLA usage") Signed-off-by: Gustavo A. R. Silva Reviewed-by: John Hubbard Reviewed-by: Kees Cook Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c index d02e183717dc..5c14d6ac855d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c @@ -801,6 +801,7 @@ acr_r352_load(struct nvkm_acr *_acr, struct nvkm_falcon *falcon, bl = acr->hsbl_unload_blob; } else { nvkm_error(_acr->subdev, "invalid secure boot blob!\n"); + kfree(bl_desc); return -EINVAL; }