summaryrefslogtreecommitdiff
path: root/drivers/iio/accel
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-27 15:05:05 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-27 15:05:05 +0100
commit6e6df27064aa0a95b6c8a2e2757de35a244649a5 (patch)
tree1f0325ed606a6355a70ec5100f8341f29550c044 /drivers/iio/accel
parent75621ae307caf4efa0a61152b667bf7083850ffe (diff)
parent86fdd15e10e404e70ecb2a3bff24d70356d42b36 (diff)
Merge tag 'iio-fixes-for-6.1d' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next
Jonathan writes: 4th set of IIO fixes for 6.1 Single patch fixing a memory leak in an error path. Fine to queue either for 6.2 if too late for 6.1 * tag 'iio-fixes-for-6.1d' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: iio: fix memory leak in iio_device_register_eventset() dt-bindings: iio: adc: Remove the property "aspeed,trim-data-valid" iio: adc: aspeed: Remove the trim valid dts property. iio: core: Fix entry not deleted when iio_register_sw_trigger_type() fails iio: accel: bma400: Fix memory leak in bma400_get_steps_reg() iio: light: rpr0521: add missing Kconfig dependencies iio: health: afe4404: Fix oob read in afe4404_[read|write]_raw iio: health: afe4403: Fix oob read in afe4403_read_raw iio: light: apds9960: fix wrong register for gesture gain
Diffstat (limited to 'drivers/iio/accel')
-rw-r--r--drivers/iio/accel/bma400_core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/accel/bma400_core.c b/drivers/iio/accel/bma400_core.c
index 81bfec9e20cc..b612d0146d4d 100644
--- a/drivers/iio/accel/bma400_core.c
+++ b/drivers/iio/accel/bma400_core.c
@@ -805,8 +805,10 @@ static int bma400_get_steps_reg(struct bma400_data *data, int *val)
ret = regmap_bulk_read(data->regmap, BMA400_STEP_CNT0_REG,
steps_raw, BMA400_STEP_RAW_LEN);
- if (ret)
+ if (ret) {
+ kfree(steps_raw);
return ret;
+ }
*val = get_unaligned_le24(steps_raw);
kfree(steps_raw);
return IIO_VAL_INT;