Quoting Tvrtko Ursulin (2019-10-25 15:21:28) > int i915_gem_open(struct drm_i915_private *i915, struct drm_file *file) > { > + int ret = -ENOMEM; > struct drm_i915_file_private *file_priv; > - int ret; > > DRM_DEBUG("\n"); > > file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL); > if (!file_priv) > - return -ENOMEM; > + goto err_alloc; > + > + file_priv->client.id = atomic_inc_return(&i915->clients.serial); We should make this a cyclic ida to avoid reuse on wraparound. 32b wraps will happen, and they will still have client 0 alive! :) That will mean we need a lock. (Of course you could use -EEXIST from add_client and keep incrementing serial until you find a hole :) -Chris _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx