diff options
author | Simon Ser <contact@emersion.fr> | 2022-10-07 18:15:24 +0200 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-10-07 19:49:28 +0000 |
commit | 5c382f6344718786842aaec0930010679cd61927 (patch) | |
tree | 1899e30a33a9ddc9c3ca6398bd129ba9102a1575 /include | |
parent | 3be6658ee7b6446e438e8d8c6c7bca3c0c0d4bc8 (diff) |
drm-lease-v1: fix error codepath
We were crashing in the error codepath [1] when
wlr_drm_create_lease() fails.
To fix this, delay the creation of the wlr_drm_lease_v1 until the
request is granted. Previously we were allocating that struct early
without populating the drm_lease field. However that means we ended
up with a half-constructed struct in the error codepath which is
annoying to handle.
[1]: https://github.com/swaywm/sway/issues/7204#issuecomment-1269797356
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_drm_lease_v1.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/wlr/types/wlr_drm_lease_v1.h b/include/wlr/types/wlr_drm_lease_v1.h index 314eb8cc..4afa11e1 100644 --- a/include/wlr/types/wlr_drm_lease_v1.h +++ b/include/wlr/types/wlr_drm_lease_v1.h @@ -71,8 +71,7 @@ struct wlr_drm_lease_request_v1 { struct wlr_drm_lease_connector_v1 **connectors; size_t n_connectors; - /** NULL until the lease is submitted */ - struct wlr_drm_lease_v1 *lease; + struct wl_resource *lease_resource; bool invalid; |