diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2018-06-15 07:59:28 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2018-07-16 18:06:29 +1000 |
commit | f7fbbf2ccaa0f557c4615a5cf3e1e5704585628a (patch) | |
tree | ef0354701ddc61d502a846a78c4c6503ebc988d4 /drivers/gpu/drm/nouveau | |
parent | f0fffeeb149e6d1fe05f2c8d6e385c5e82814cff (diff) | |
download | linux-f7fbbf2ccaa0f557c4615a5cf3e1e5704585628a.tar.bz2 |
drm/nouveau/core: ERR_PTR vs NULL bug in nvkm_engine_info()
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/core/engine.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/core/engine.c b/drivers/gpu/drm/nouveau/nvkm/core/engine.c index d0322ce85172..1a47c40e171b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/engine.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/engine.c @@ -87,11 +87,12 @@ nvkm_engine_info(struct nvkm_subdev *subdev, u64 mthd, u64 *data) { struct nvkm_engine *engine = nvkm_engine(subdev); if (engine->func->info) { - if ((engine = nvkm_engine_ref(engine))) { + if (!IS_ERR((engine = nvkm_engine_ref(engine)))) { int ret = engine->func->info(engine, mthd, data); nvkm_engine_unref(&engine); return ret; } + return PTR_ERR(engine); } return -ENOSYS; } |