Skip to content

Commit a1b40b3

Browse files
Merge pull request #562 from Vigeant/master
fix a memory leak when a device fails to reset. (BSP-670)
2 parents 76cc903 + 3a7d90b commit a1b40b3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

components/io_expander/esp_io_expander_tca9554/esp_io_expander_tca9554.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@ esp_err_t esp_io_expander_new_i2c_tca9554(i2c_master_bus_handle_t i2c_bus, uint3
7878
tca9554->base.reset = reset;
7979

8080
/* Reset configuration and register status */
81-
ESP_GOTO_ON_ERROR(reset(&tca9554->base), err, TAG, "Reset failed");
81+
ESP_GOTO_ON_ERROR(reset(&tca9554->base), err1, TAG, "Reset failed");
8282

8383
*handle_ret = &tca9554->base;
8484
return ESP_OK;
85+
err1:
86+
i2c_master_bus_rm_device(tca9554->i2c_handle);
8587
err:
8688
free(tca9554);
8789
return ret;

components/io_expander/esp_io_expander_tca9554/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "2.0.0"
1+
version: "2.0.1"
22
description: ESP IO Expander - TCA9554(A)
33
url: https://github.com/espressif/esp-bsp/tree/master/components/io_expander/esp_io_expander_tca9554
44
dependencies:

0 commit comments

Comments
 (0)