1
0
Fork 0
alistair23-linux/drivers/nvmem
Martin Blumenstingl 8a42d3fc9d nvmem: meson-mx-efuse: fix reading from an offset other than 0
meson_mx_efuse_read calculates the address internal to the eFuse based
on the offset and the word size. This works fine with any given offset.
However, the offset is also included when writing to the output buffer.
This means that reading 4 bytes at offset 500 tries to write beyond the
array allocated by the nvmem core as it wants to write the 4 bytes to
"buffer address + offset (500)".
This issue did not show up in the previous tests since no driver uses
any value from the eFuse yet and reading the eFuse via sysfs simply
reads the whole eFuse, starting at offset 0.

Fix this by only including the offset in the internal address
calculation.

Fixes: 8caef1fa91 ("nvmem: add a driver for the Amlogic Meson6/Meson8/Meson8b SoCs")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-23 16:46:23 +01:00
..
Kconfig nvmem: uniphier: add UniPhier eFuse driver 2017-11-08 14:19:05 +01:00
Makefile Char/Misc patches for 4.15-rc1 2017-11-16 09:10:59 -08:00
bcm-ocotp.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
core.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
imx-iim.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
imx-ocotp.c nvmem: imx-ocotp: Update module description 2017-11-08 14:19:06 +01:00
lpc18xx_eeprom.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
lpc18xx_otp.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
meson-efuse.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
meson-mx-efuse.c nvmem: meson-mx-efuse: fix reading from an offset other than 0 2017-12-23 16:46:23 +01:00
mtk-efuse.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
mxs-ocotp.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
qfprom.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
rockchip-efuse.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
snvs_lpgpr.c nvmem: add snvs_lpgpr driver 2017-10-04 10:30:53 +02:00
sunxi_sid.c nvmem: sunxi-sid: add support for A64/H5's SID controller 2017-11-08 14:19:06 +01:00
uniphier-efuse.c nvmem: uniphier: add UniPhier eFuse driver 2017-11-08 14:19:05 +01:00
vf610-ocotp.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00