summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidycchen <davidycchen@google.com>2022-05-09 09:44:10 +0800
committerdavidycchen <davidycchen@google.com>2022-05-09 09:44:10 +0800
commit4589584c6511ea59c0a344638f2f0298841561ad (patch)
tree525db61f9e273a69803bbd31bf7a277bee3ed769
parent6b3b4dff8a6b77e775948f2dd414e50ead52c541 (diff)
downloadfts_touch-4589584c6511ea59c0a344638f2f0298841561ad.tar.gz
fst2: modify the unregistration order whe the driver probe fails.
Before this patch, unregister_panel_bridge may be called before register_panel_bridge is called and cause null pointer condition. Bug: 226474785 Bug: 231769112 Test: No error when the panel is not connected. Signed-off-by: davidycchen <davidycchen@google.com> Change-Id: I5a83cc5e7b3fd7df4964a72e022f1a85536efd10
-rw-r--r--fst2/fts.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fst2/fts.c b/fst2/fts.c
index 27ee6c5..82fa0dd 100644
--- a/fst2/fts.c
+++ b/fst2/fts.c
@@ -1495,7 +1495,7 @@ static int fts_probe(struct spi_device *client)
if (!info->fwu_workqueue) {
log_info(1, "%s ERROR: Cannot create fwu work thread\n",
__func__);
- goto probe_error_exit_6;
+ goto probe_error_exit_7;
}
INIT_DELAYED_WORK(&info->fwu_work, flash_update_auto);
#endif
@@ -1506,8 +1506,10 @@ static int fts_probe(struct spi_device *client)
log_info(1, "%s: Probe Finished!\n", __func__);
return OK;
-probe_error_exit_6:
+probe_error_exit_7:
unregister_panel_bridge(&info->panel_bridge);
+
+probe_error_exit_6:
input_unregister_device(info->input_dev);
probe_error_exit_5: