drm: Release reference from blob lookup after replacing property
authorFelix Monninger <felix.monninger@gmail.com>
Tue, 25 Oct 2016 21:28:08 +0000 (22:28 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 26 Oct 2016 08:28:10 +0000 (10:28 +0200)
commitcac5fcedaabdadf150c8a9be9fee76defc8ba444
treebaede9f453be91b7c875ea4589b13c80a622bcb2
parent07d9a380680d1c0eb51ef87ff2eab5c994949e69
drm: Release reference from blob lookup after replacing property

drm_property_lookup_blob() returns a reference to the returned blob, and
drm_atomic_replace_property_blob() takes a references to the blob it
stores, so afterwards we are left owning a reference to the new_blob that
we never release, and thus leak memory every time we update a property
such as during drm_atomic_helper_legacy_gamma_set().

v2: update credentials, drm_property_unreference_blob() is NULL safe and
NULL is passed consistently to it throughout drm_atomic.c so do so here.

Reported-by: Felix Monninger <felix.monninger@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98420
Signed-off-by: Felix Monninger <felix.monninger@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
Fixes: 5488dc16fde7 ("drm: introduce pipe color correction properties")
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161025212808.3908-1-chris@chris-wilson.co.uk
drivers/gpu/drm/drm_atomic.c