lkml.org 
[lkml]   [2019]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 2/3] drm: Add a drm_gem_objects_lookup helper
Date
Quoting Daniel Vetter (2019-04-01 14:06:48)
> On Mon, Apr 1, 2019 at 9:47 AM Rob Herring <robh@kernel.org> wrote:
> > +{
> > + int i, ret = 0;
> > + struct drm_gem_object *obj;
> > +
> > + spin_lock(&filp->table_lock);
> > +
> > + for (i = 0; i < count; i++) {
> > + /* Check if we currently have a reference on the object */
> > + obj = idr_find(&filp->object_idr, handle[i]);
> > + if (!obj) {
> > + ret = -ENOENT;

Unwind previous drm_gem_object_get(), the caller has no idea how many
were processed before the error.
-Chris

\
 
 \ /
  Last update: 2019-04-01 15:50    [W:0.076 / U:6.684 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site