[PATCH 04/17] drm: add object property type

Daniel Vetter daniel at ffwll.ch
Mon May 26 01:33:04 PDT 2014


On Mon, May 26, 2014 at 10:29:47AM +0200, Daniel Vetter wrote:
> On Sat, May 24, 2014 at 02:30:13PM -0400, Rob Clark wrote:
> > +	} else if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) {
> > +		/* a zero value for an object property translates to null: */
> > +		if (value == 0)
> > +			return true;
> > +		return drm_property_get_obj(property, value) != NULL;
> 
> Ok, so this usage is indeed safe for framebuffers since you only compare
> the pointer against NULL. But you can't ever access this pointer since it
> might disappear any time after you've dropped the idr lock. I think what
> you actually want here is a new interface drm_mode_object_exists which
> just returns a bool.
> 
> That won't expose any risky things to callers and we can still keep the
> restriction that calling drm_mode_object_get for framebuffers is a BUG.

s/object_get/object_find/ I've meant ofc.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the dri-devel mailing list