From b4dc6d9f77d3bdf3c24fa47267e767b266fdc27d Mon Sep 17 00:00:00 2001 From: liuanxing Date: Sat, 4 Nov 2023 11:02:57 +0800 Subject: [PATCH] fix: touch-screen null pointer Change-Id: Ia08fd2a561d7c45e88c74d22ebf8f865b0539105 Signed-off-by: liuanxing --- framework/model/input/driver/hdf_touch.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/framework/model/input/driver/hdf_touch.c b/framework/model/input/driver/hdf_touch.c index 5b5fad444..52aec409c 100644 --- a/framework/model/input/driver/hdf_touch.c +++ b/framework/model/input/driver/hdf_touch.c @@ -1075,7 +1075,9 @@ static int HdfTouchDriverDozeResume(struct HdfDeviceObject *device) } HDF_LOGI("%s:called", __func__); #if GTP_ESD_PROTECT - Gt1xEsdSwitch(1); + if (gt1x_workqueue) { + Gt1xEsdSwitch(1); + } #endif SuspendFlag = 0; static int32_t isFirstResume = 1; @@ -1097,7 +1099,9 @@ static int HdfTouchDriverDozeSuspend(struct HdfDeviceObject *device) } HDF_LOGI("%s:called", __func__); #if GTP_ESD_PROTECT - Gt1xDeinitEsdProtect(); + if (gt1x_workqueue) { + Gt1xDeinitEsdProtect(); + } #endif SuspendFlag = 1; int32_t ret = -1; -- Gitee