From da42268911c3fc9f591783e0c3cdd4511930612a Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 24 Jul 2025 08:39:54 +0200 Subject: [PATCH] goodixmoc: fix crash in exit callback handler If the button shield command cannot be executed due to an underlying error then resp is NULL. Avoid the crash by adding the appropriate check. Closes: #694 --- libfprint/drivers/goodixmoc/goodix.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libfprint/drivers/goodixmoc/goodix.c b/libfprint/drivers/goodixmoc/goodix.c index 33e137f4..659722ae 100644 --- a/libfprint/drivers/goodixmoc/goodix.c +++ b/libfprint/drivers/goodixmoc/goodix.c @@ -1483,9 +1483,7 @@ gx_fp_exit_cb (FpiDeviceGoodixMoc *self, gxfp_cmd_response_t *resp, GError *error) { - - - if (resp->result >= GX_FAILED) + if (resp && resp->result >= GX_FAILED) fp_dbg ("Setting power button shield failed, result: 0x%x", resp->result); self->is_power_button_shield_on = false; gx_fp_release_interface (self, error);