Files
mi8-platina-linux/ports/candidate/linux-postmarketos-qcom-sdm660/0041-novatek-nvt-ts-null-check.patch
T
shenlei 8b7e9690d8
Offline project checks / check (push) Canceled after 0s
fix(cellular, touch): prevent baseband crash loop, add touch NULL guard, and safe SIM info queries
- Guard cellular auto-dialing: check for active IPA/rmnet hardware datapath before connecting, avoiding Hexagon modem DSP assert panics.
- Disable connection.autoconnect on cellular network profiles to prevent NetworkManager auto-dial loops.
- Add QMI fallback for modem/SIM status queries when ModemManager lacks netdev port.
- Fix Novatek touchscreen driver NULL pointer dereference on panel unprepare/suspend (0041 patch).
- Bump candidate kernel release to 7.2.12-r14 with updated checksums and DT binding supplies.
- Add comprehensive test coverage for cellular datapath detection and connection guards.
2026-11-09 17:53:55 +09:00

42 lines
1.2 KiB
Diff

From: Antigravity <antigravity@local>
Subject: [PATCH] Input: novatek-nvt-ts - fix NULL pointer dereference in follower unprepare
When on_novatek_panel_prepared fails to initialize the touch controller
(e.g., due to unsupported parameters or communication error), data->input
is never allocated. During unprepare or suspend, accessing data->input->mutex
causes a kernel NULL pointer dereference.
Add NULL checks before accessing data->input in unprepare, suspend, and resume.
--- a/drivers/input/touchscreen/novatek-nvt-ts.c
+++ b/drivers/input/touchscreen/novatek-nvt-ts.c
@@ -194,6 +194,9 @@
if (data->is_panel_follower)
return 0;
+ if (!data->input)
+ return 0;
+
guard(mutex)(&data->input->mutex);
if (input_device_enabled(data->input))
@@ -208,6 +211,9 @@
if (data->is_panel_follower)
return 0;
+ if (!data->input)
+ return 0;
+
guard(mutex)(&data->input->mutex);
if (input_device_enabled(data->input))
@@ -350,6 +356,9 @@
struct nvt_ts_data *data = container_of(follower, struct nvt_ts_data, panel_follower);
dev_info(&data->client->dev, "%s\n", __func__); // REMOVEME
+ if (!data->input)
+ return 0;
+
guard(mutex)(&data->input->mutex);
if (input_device_enabled(data->input))