Alexandre Courbot
2017-Mar-15 05:44 UTC
[Nouveau] [PATCH] secboot: fix inconsistent pointer checking
We were returning PTR_ERR() on a NULL pointer, which obviously won't work. nvkm_engine_ref() will return an error in case something went wrong. Signed-off-by: Alexandre Courbot <acourbot at nvidia.com> Reported-by: Dan Carpenter <dan.carpenter at oracle.com> --- drm/nouveau/nvkm/subdev/secboot/gp102.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drm/nouveau/nvkm/subdev/secboot/gp102.c b/drm/nouveau/nvkm/subdev/secboot/gp102.c index 8570c84c8a29..f3b3c66349d2 100644 --- a/drm/nouveau/nvkm/subdev/secboot/gp102.c +++ b/drm/nouveau/nvkm/subdev/secboot/gp102.c @@ -59,7 +59,8 @@ gp102_run_secure_scrub(struct nvkm_secboot *sb) nvkm_debug(subdev, "running VPR scrubber binary on NVDEC...\n"); - if (!(engine = nvkm_engine_ref(&device->nvdec->engine))) + engine = nvkm_engine_ref(&device->nvdec->engine); + if (IS_ERR(engine)) return PTR_ERR(engine); falcon = device->nvdec->falcon; -- 2.12.0
Apparently Analagous Threads
- [bug report] drm/nouveau/secboot: add gp102/gp104/gp106/gp107 support
- [bug report] drm/nouveau/secboot/gm20b: add secure boot support
- [PATCH v3 10/15] secboot: split reset function
- [PATCH 03/11] drm/nouveau: secboot: Read WPR configuration from GPU registers
- [PATCH] secboot: print status message on success