drivers: adc: lmp90xxx: fix incorrect buffer size

sizeof() reported the size of the val pointer, not the variable size.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2021-05-25 15:59:56 +02:00 committed by Kumar Gala
commit 2352da2e56

View file

@ -247,7 +247,7 @@ static int lmp90xxx_read_reg(const struct device *dev, uint8_t addr,
static int lmp90xxx_read_reg8(const struct device *dev, uint8_t addr, static int lmp90xxx_read_reg8(const struct device *dev, uint8_t addr,
uint8_t *val) uint8_t *val)
{ {
return lmp90xxx_read_reg(dev, addr, val, sizeof(val)); return lmp90xxx_read_reg(dev, addr, val, sizeof(*val));
} }
static int lmp90xxx_write_reg(const struct device *dev, uint8_t addr, static int lmp90xxx_write_reg(const struct device *dev, uint8_t addr,