AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 27 Bitcoin

input: release touch handles before deleting the i2c bus

Public commit record

What the developer wrote

Authored by Gustavo Cateim

86/100 · Strong
input: release touch handles before deleting the i2c bus

Since ESP-IDF v5.5 (espressif/esp-idf@e73d78ba) i2c_del_master_bus()
refuses to delete a bus that still has devices attached and returns
ESP_ERR_INVALID_STATE. The touchscreen task registers a panel IO
device on the bus but never releases it, so under IDF 5.5.4 the first
touchscreen_deinit() fails and aborts via ESP_ERROR_CHECK.

On boards that panic with PRINT_HALT, such as the Waveshare S3 Touch
LCD 2, this freezes the device on the boot splash screen while
gathering camera entropy, and also hangs the QR scanner and the
camera exit path, since the touchscreen is restarted around every
camera start/stop (see #306).

Releasing the touch handle and the panel IO device (which removes it
from the bus) before deleting the bus restores the deinit/init cycle,
and also fixes a heap leak present under IDF 5.4 where both handles
leaked on every cycle.

Co-authored-by: oroderico <oroderico@users.noreply.github.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes a bug where the touchscreen driver failed to clean up internal handles when shutting down. On newer ESP-IDF firmware, this cleanup failure caused the device to panic and freeze during boot and when using the camera or QR scanner. The fix releases the touch and panel IO handles before deleting the I2C bus, preventing freezes and a memory leak. There is no evidence this is a security vulnerability or exploitable by an attacker.

Recommended action

Treat as a reliability/functional bug fix, not a security patch. Apply the commit to prevent device freezes and memory leaks on ESP-IDF v5.5+ builds. No special security response is indicated.

Security signals we found

01

Device freeze/DoS-like symptom on affected hardware

02

Memory leak fixed

03

No input validation, authentication, or cryptographic weakness visible

04

No attacker-controlled code path identified

Risk score

Why this scored 27/100

Our methodology →
Potential impact 8/30
Exploitability 0/25
Stealth signal 2/15
Affected reach 5/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.