mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-06-19 17:18:21 +02:00
libweston: fix crash when getting connector's property failed
When weston tries to update drm head info, if the connector is disconnected, it cannot get the connector's property. If get connector's property failed, drm_connector_assign_connector_info returns -1 and head->connector->conn, head->connector->props_drm remain to be nullptr, but they are used in update_head_from_connector, so the crash occurs. So just return ret when drm_connector_assign_connector_info returns -1, and head->connector, head->connector will not be used later. Signed-off-by: xufeng wang <550002860@gehealthcare.com>
This commit is contained in:
parent
8762c3bab5
commit
5eb316d77c
1 changed files with 5 additions and 4 deletions
|
|
@ -2836,10 +2836,11 @@ drm_head_update_info(struct drm_head *head, drmModeConnector *conn)
|
|||
int ret;
|
||||
|
||||
ret = drm_connector_assign_connector_info(&head->connector, conn);
|
||||
|
||||
update_head_from_connector(head);
|
||||
weston_head_set_content_protection_status(&head->base,
|
||||
drm_head_get_current_protection(head));
|
||||
if (ret == 0) {
|
||||
update_head_from_connector(head);
|
||||
weston_head_set_content_protection_status(&head->base,
|
||||
drm_head_get_current_protection(head));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue