drm: Retain reference to blob properties in lookup
authorDaniel Stone <daniels@collabora.com>
Mon, 25 May 2015 18:11:49 +0000 (19:11 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 26 May 2015 06:36:52 +0000 (08:36 +0200)
When we look up a blob property, make sure we retain a reference to the
blob for the lifetime.

v2: Use DRM_MODE_PROP_BLOB, not PROP_OBJECT + OBJECT_BLOB.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Tested-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_crtc.c

index e548c50edc948a4695928c56a9daa89dfa308126..2de6edf821c75ecd74441a88355ce02eb1c4a9c8 100644 (file)
@@ -4775,7 +4775,8 @@ void drm_property_change_valid_put(struct drm_property *property,
        if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) {
                if (property->values[0] == DRM_MODE_OBJECT_FB)
                        drm_framebuffer_unreference(obj_to_fb(ref));
-       }
+       } else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB))
+               drm_property_unreference_blob(obj_to_blob(ref));
 }
 
 /**