compositor-drm: drm_property_info_free() must reset
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Thu, 7 Sep 2017 12:32:01 +0000 (15:32 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Mon, 12 Feb 2018 14:49:34 +0000 (16:49 +0200)
commit46e4f97ab62a026968ca2d919a79bd2dd0a3c73a
tree942fd8eab4f3017ed06040671684ef8c20e0940b
parent383b3af5e1dc354c2594390a10bcd2ec494b5185
compositor-drm: drm_property_info_free() must reset

This function needs to reset the structures to NULL, otherwise it is not
possible to re-use a once "freed" property info array.

Being able to re-use an array is useful when the memory allocation and
array lifetimes do not match. A specific example is drm_output that is
changed to allocate the CRTC on enable() and deallocate it on disable().
A drm_output might be enabled and disabled multiple times.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
libweston/compositor-drm.c