summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvkm/subdev
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2017-03-15 08:44:34 +0300
committerDave Airlie <airlied@redhat.com>2017-03-17 03:08:24 +0300
commitaa7fc0ca759eb25eea6dc0fee4373e5883a17498 (patch)
tree28e38930e2446e3a9e201a2e0bd5b30a4be3768f /drivers/gpu/drm/nouveau/nvkm/subdev
parent9c233760a65cec0c98df7b62bc5185d8889e5fc7 (diff)
downloadlinux-aa7fc0ca759eb25eea6dc0fee4373e5883a17498.tar.xz
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: Alexandre Courbot <acourbot@nvidia.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gp102.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gp102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gp102.c
index 8570c84c8a29..f3b3c66349d2 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gp102.c
+++ b/drivers/gpu/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;