summaryrefslogtreecommitdiff
path: root/drivers/nvmem/imx-iim.c
diff options
context:
space:
mode:
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>2017-12-15 16:42:04 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-23 18:46:23 +0300
commit8a42d3fc9dfccbf601c5f58f46dc3cdbc1a4b923 (patch)
tree3dd0098a410f0ffd4916bfc97574f4b23e11835b /drivers/nvmem/imx-iim.c
parent7f3dc0088b98533f17128058fac73cd8b2752ef1 (diff)
downloadlinux-8a42d3fc9dfccbf601c5f58f46dc3cdbc1a4b923.tar.xz
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: 8caef1fa9176 ("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>
Diffstat (limited to 'drivers/nvmem/imx-iim.c')
0 files changed, 0 insertions, 0 deletions