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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux