mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-06-07 06:28:19 +02:00
xwayland: check queued DRM lease allocation
registry_global() queues DRM lease devices before the root window is available and initializes the queued entry immediately after malloc(). Return early on allocation failure to avoid dereferencing a NULL pointer. Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2217>
This commit is contained in:
parent
731cb81ba1
commit
872ece04f9
1 changed files with 4 additions and 0 deletions
|
|
@ -540,6 +540,10 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id,
|
|||
else if (strcmp(interface, wp_drm_lease_device_v1_interface.name) == 0) {
|
||||
if (xwl_screen->screen->root == NULL) {
|
||||
struct xwl_queued_drm_lease_device *queued = malloc(sizeof(struct xwl_queued_drm_lease_device));
|
||||
if (!queued) {
|
||||
ErrorF("%s: ENOMEM\n", __func__);
|
||||
return;
|
||||
}
|
||||
queued->id = id;
|
||||
xorg_list_append(&queued->link, &xwl_screen->queued_drm_lease_devices);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue