From c01ac52b296aa794476784a246f8e4117b6b6e06 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 14 Sep 2021 16:22:17 +0200 Subject: [PATCH] xwayland: Fix memory allocation test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Due to a typo in tablet_pad_group(), we would allocate a variable ("group") and test another one ("pad") for allocation success. Spotted by covscan. Signed-off-by: Olivier Fourdan Fixes: commit 8475e63 - "xwayland: add tablet pad support" Reviewed-by: Peter Hutterer Reviewed-by: Michel Dänzer --- hw/xwayland/xwayland-input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index 26b3630c7..8482c89ae 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -2268,7 +2268,7 @@ tablet_pad_group(void *data, struct xwl_tablet_pad_group *group; group = calloc(1, sizeof *group); - if (pad == NULL) { + if (group == NULL) { ErrorF("%s ENOMEM\n", __func__); return; }