drm-backend: free old connector props before replacing it with newer data
In commitc1e89ba2
"compositor-drm: move connector fields into drm_head" the function drm_head_assign_connector_info() was introduced. By that time it was being used only at drm_head creation, and not to handle connector changes. Ind2e6242e
"compositor-drm: create heads for all connectors" it started to be used also to handle connector changes. In this scenario we replace old connector props with newer data. Before doing this, free the old connector data to avoid memory leak. Note that as drm_property_info_free() is safe to be called on a zero-initialized struct, we can call it even in the case where the head is being created and there are no props yet. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This commit is contained in:
parent
3d6721eb15
commit
bb33f90658
|
@ -2021,6 +2021,7 @@ drm_head_assign_connector_info(struct drm_head *head,
|
|||
drmModeFreeConnector(head->connector);
|
||||
head->connector = connector;
|
||||
|
||||
drm_property_info_free(head->props_conn, WDRM_CONNECTOR__COUNT);
|
||||
drm_property_info_populate(head->backend, connector_props,
|
||||
head->props_conn,
|
||||
WDRM_CONNECTOR__COUNT, props);
|
||||
|
|
Loading…
Reference in New Issue