Commit 74a07c0a authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Ben Skeggs

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: 0d466901 ("drm/nouveau/secboot/acr: Remove VLA usage")
Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 9340d77f
...@@ -801,6 +801,7 @@ acr_r352_load(struct nvkm_acr *_acr, struct nvkm_falcon *falcon, ...@@ -801,6 +801,7 @@ acr_r352_load(struct nvkm_acr *_acr, struct nvkm_falcon *falcon,
bl = acr->hsbl_unload_blob; bl = acr->hsbl_unload_blob;
} else { } else {
nvkm_error(_acr->subdev, "invalid secure boot blob!\n"); nvkm_error(_acr->subdev, "invalid secure boot blob!\n");
kfree(bl_desc);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment