[Nouveau] [bug report] drm/nouveau/object: merge with handle

Dan Carpenter dan.carpenter at oracle.com
Thu May 4 06:58:42 UTC 2017


Hello Ben Skeggs,

The patch fbd58ebda9c8: "drm/nouveau/object: merge with handle" from
Aug 20, 2015, leads to the following static checker warning:

	drivers/gpu/drm/nouveau/nvkm/core/object.c:298 nvkm_object_ctor()
	warn: 'object->engine' is an error pointer or valid

drivers/gpu/drm/nouveau/nvkm/core/object.c
   283  void
   284  nvkm_object_ctor(const struct nvkm_object_func *func,
   285                   const struct nvkm_oclass *oclass, struct nvkm_object *object)
   286  {
   287          object->func = func;
   288          object->client = oclass->client;
   289          object->engine = nvkm_engine_ref(oclass->engine);
   290          object->oclass = oclass->base.oclass;
   291          object->handle = oclass->handle;
   292          object->route  = oclass->route;
   293          object->token  = oclass->token;
   294          object->object = oclass->object;
   295          INIT_LIST_HEAD(&object->head);
   296          INIT_LIST_HEAD(&object->tree);
   297          RB_CLEAR_NODE(&object->node);
   298          WARN_ON(oclass->engine && !object->engine);
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If oclass->engine is non-NULL then object->engine also can't be NULL.
It could be an error pointer though so perhaps we intended to check for
that?  Or it's also possible that we want it as is.

   299  }

regards,
dan carpenter


More information about the Nouveau mailing list