Skip to contentSkip to conversation

secboot: fix inconsistent pointer checking

PATCH New Alexandre Courbot 1 participant 1 message Mar 15, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drm/nouveau/nvkm/subdev/secboot/gp102.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drm/nouveau/nvkm/subdev/secboot/gp102.c +2 -1
index 8570c84c8a29..f3b3c66349d2 100644
@@ -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;
 
Signature · 6 lines
2.12.0

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau