fix(i2c): release platform mutex on intr/pm_lock delete failure

ESP_RETURN_ON_ERROR inside the s_i2c_platform.mutex critical section
returns without releasing the mutex, permanently blocking all I2C
bus operations. Replace with ESP_GOTO_ON_ERROR that jumps to a
cleanup label releasing the mutex before return.
This commit is contained in:
morris
2026-07-09 10:27:01 +08:00
parent 56f56b887b
commit 73031f7280
3 changed files with 29 additions and 15 deletions
+3
View File
@@ -907,6 +907,9 @@ static esp_err_t i2c_master_bus_destroy(i2c_master_bus_handle_t bus_handle)
if (err == ESP_OK) {
err = release_ret;
}
// Non-OK here means interrupt teardown did not complete, so the ISR
// may still reference i2c_master and its wrapper-owned resources.
return err;
}
}