summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com>2023-01-08 18:57:43 -0800
committerSecurityBot <android-nexus-securitybot@system.gserviceaccount.com>2023-01-08 18:57:43 -0800
commit7ab600322e6f16d213f9af7db1f42b642a0e43c5 (patch)
tree48ef9efbeccdbe22a3acc926a24fbb1ceca6382c
parent70342895e8e0d0cb86919a3f27e3a0c527b4af68 (diff)
parentab5ad8a0698bee68c6c04929202242fb83d37ad3 (diff)
downloadsynaptics_touch-7ab600322e6f16d213f9af7db1f42b642a0e43c5.tar.gz
SBMerger: 478053055 Change-Id: I76365a5dfef67c5088df9f1116be1e405ba7e98f Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
-rw-r--r--syna_tcm2.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/syna_tcm2.c b/syna_tcm2.c
index dcd10d2..e6d7610 100644
--- a/syna_tcm2.c
+++ b/syna_tcm2.c
@@ -3350,10 +3350,6 @@ static int syna_dev_remove(struct platform_device *pdev)
if (tcm->tbn_register_mask)
unregister_tbn(&tcm->tbn_register_mask);
#endif
- cpu_latency_qos_remove_request(&tcm->pm_qos_req);
-
- if (tcm->raw_data_buffer)
- kfree(tcm->raw_data_buffer);
#if defined(USE_DRM_BRIDGE)
syna_unregister_panel_bridge(&tcm->panel_bridge);
@@ -3372,6 +3368,12 @@ static int syna_dev_remove(struct platform_device *pdev)
syna_cdev_remove_sysfs(tcm);
#endif
+ /* check the connection statusm, and do disconnection */
+ if (tcm->dev_disconnect(tcm) < 0)
+ LOGE("Fail to do device disconnection\n");
+
+ cpu_latency_qos_remove_request(&tcm->pm_qos_req);
+
#if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD)
touch_offload_cleanup(&tcm->offload);
#endif
@@ -3380,9 +3382,10 @@ static int syna_dev_remove(struct platform_device *pdev)
heatmap_remove(&tcm->v4l2);
#endif
- /* check the connection statusm, and do disconnection */
- if (tcm->dev_disconnect(tcm) < 0)
- LOGE("Fail to do device disconnection\n");
+ if (tcm->raw_data_buffer) {
+ kfree(tcm->raw_data_buffer);
+ tcm->raw_data_buffer = NULL;
+ }
syna_tcm_buf_release(&tcm->event_data);