From e805bc0660825c1037f78ab9e70b10ab303ff0f2 Mon Sep 17 00:00:00 2001 From: Petro Karashchenko Date: Sun, 3 Nov 2019 19:31:49 -0600 Subject: [PATCH] Various drivers: Cloned logic. On error, memory was freed, but the error was not returned. It just continued as though no error happened. --- drivers/i2c/i2c_driver.c | 1 + drivers/i2s/i2schar.c | 1 + drivers/spi/spi_driver.c | 1 + include/nuttx/analog/adc.h | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/i2c_driver.c b/drivers/i2c/i2c_driver.c index 422b8651d4..00f8eba39a 100644 --- a/drivers/i2c/i2c_driver.c +++ b/drivers/i2c/i2c_driver.c @@ -409,6 +409,7 @@ int i2c_register(FAR struct i2c_master_s *i2c, int bus) */ kmm_free(priv); + return ret; } /* Return the result of the registration */ diff --git a/drivers/i2s/i2schar.c b/drivers/i2s/i2schar.c index 21f37ac055..9b23abc535 100644 --- a/drivers/i2s/i2schar.c +++ b/drivers/i2s/i2schar.c @@ -439,6 +439,7 @@ int i2schar_register(FAR struct i2s_dev_s *i2s, int minor) */ kmm_free(priv); + return ret; } /* Return the result of the registration */ diff --git a/drivers/spi/spi_driver.c b/drivers/spi/spi_driver.c index 5f930b62df..2d43c8eec0 100644 --- a/drivers/spi/spi_driver.c +++ b/drivers/spi/spi_driver.c @@ -398,6 +398,7 @@ int spi_register(FAR struct spi_dev_s *spi, int bus) */ kmm_free(priv); + return ret; } /* Return the result of the registration */ diff --git a/include/nuttx/analog/adc.h b/include/nuttx/analog/adc.h index 8826c760fb..c1eea3ea42 100644 --- a/include/nuttx/analog/adc.h +++ b/include/nuttx/analog/adc.h @@ -128,7 +128,7 @@ struct adc_fifo_s /* This structure defines all of the operations providd by the architecture specific * logic. All fields must be provided with non-NULL function pointers by the - * caller of can_register(). + * caller of adc_register(). */ struct adc_dev_s;