Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa7fc0ca authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Dave Airlie
Browse files

drm/nouveau/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: default avatarAlexandre Courbot <acourbot@nvidia.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 9c233760
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;