From 479c8aae8e6e6059f77be8de79726e7f6eac61a9 Mon Sep 17 00:00:00 2001 From: Weng Xuetian Date: Sat, 16 Apr 2022 01:40:45 -0700 Subject: [PATCH] xwayland: Fix invalid pointer access in drm_lease_device_handle_released. drm_lease_device_handle_released uses the wrong pointer type in the callback. This will cause crash when compositor removes drm lease device object. Fixes: 089e7f98f - Xwayland: implement drm-lease-v1 Reviewed-by: Olivier Fourdan Signed-off-by: Weng Xuetian --- hw/xwayland/xwayland-drm-lease.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland-drm-lease.c b/hw/xwayland/xwayland-drm-lease.c index 656e6a62d..8bbb27e70 100644 --- a/hw/xwayland/xwayland-drm-lease.c +++ b/hw/xwayland/xwayland-drm-lease.c @@ -386,7 +386,8 @@ static void drm_lease_device_handle_released(void *data, struct wp_drm_lease_device_v1 *wp_drm_lease_device_v1) { - xwl_screen_destroy_drm_lease_device(data, wp_drm_lease_device_v1); + struct xwl_drm_lease_device *lease_device = data; + xwl_screen_destroy_drm_lease_device(lease_device->xwl_screen, wp_drm_lease_device_v1); } static void