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>
This commit is contained in:
Родитель
f0fffeeb14
Коммит
f7fbbf2cca
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче