From: Ben Skeggs Date: Thu, 20 Aug 2015 04:54:16 +0000 (+1000) Subject: drm/nouveau/nvif: return success from sclass even for objects without children X-Git-Tag: v5.15~15142^2~11^2~97 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=5c15bf709eb6fb52c5bcb95d545250dde22f9625;p=mirror_ubuntu-kernels.git drm/nouveau/nvif: return success from sclass even for objects without children Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c b/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c index 629ee56dd8ab..ee6ff01c2b1b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c @@ -57,18 +57,18 @@ nvkm_ioctl_sclass(struct nvkm_handle *handle, void *data, u32 size) } *args = data; int ret; - if (!nv_iclass(object, NV_PARENT_CLASS)) { - nvif_debug(object, "cannot have children (sclass)\n"); - return -ENODEV; - } - nvif_ioctl(object, "sclass size %d\n", size); if (nvif_unpack(args->v0, 0, 0, true)) { nvif_ioctl(object, "sclass vers %d count %d\n", args->v0.version, args->v0.count); if (size == args->v0.count * sizeof(args->v0.oclass[0])) { - ret = nvkm_parent_lclass(object, args->v0.oclass, + if (nv_iclass(object, NV_PARENT_CLASS)) { + ret = nvkm_parent_lclass(object, + args->v0.oclass, args->v0.count); + } else { + ret = 0; + } if (ret >= 0) { args->v0.count = ret; ret = 0;