Skip to content

Commit

Permalink
drm/nouveau/secboot: fix inconsistent pointer checking
Browse files Browse the repository at this point in the history
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@nvidia.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Alexandre Courbot authored and Dave Airlie committed Mar 17, 2017
1 parent 9c23376 commit aa7fc0c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gp102.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit aa7fc0c

Please sign in to comment.