diff options
author | Heiko Stuebner <heiko@sntech.de> | 2019-09-25 21:40:56 +0300 |
---|---|---|
committer | Kever Yang <kever.yang@rock-chips.com> | 2019-09-28 17:26:32 +0300 |
commit | 03f98b75e47ef9df890d92b4989fdd209ba55734 (patch) | |
tree | b8a877876bae5332bf9233806a784a34365d6373 /arch/arm/mach-rockchip/misc.c | |
parent | dfd590075ca263d6b3ed22465a94d33a8ee93e07 (diff) | |
download | u-boot-03f98b75e47ef9df890d92b4989fdd209ba55734.tar.xz |
rockchip: misc: read the correct number of bytes from the efuse
Originally the cpuid var the value gets read into was defined as
u8 cpuid[RK3399_CPUID_LEN];
hence the sizeof(cpuid) would return the correct the correct number
of array elements.
With the move to a separate function cpuid becomes a pointer and
sizeof(cpuid) hence returns the pointer size - 8 in the arm64 case.
We do have the actual id length available as function param so use
it for actual amount of bytes to read.
Fixes: 04825384999f ("rockchip: rk3399: derive ethaddr from cpuid")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Kever Yang<kever.yang@rock-chips.com>
Diffstat (limited to 'arch/arm/mach-rockchip/misc.c')
-rw-r--r-- | arch/arm/mach-rockchip/misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-rockchip/misc.c b/arch/arm/mach-rockchip/misc.c index fdb763cc53..c0e4fdbc00 100644 --- a/arch/arm/mach-rockchip/misc.c +++ b/arch/arm/mach-rockchip/misc.c @@ -70,7 +70,7 @@ int rockchip_cpuid_from_efuse(const u32 cpuid_offset, } /* read the cpu_id range from the efuses */ - ret = misc_read(dev, cpuid_offset, cpuid, sizeof(cpuid)); + ret = misc_read(dev, cpuid_offset, cpuid, cpuid_length); if (ret) { debug("%s: reading cpuid from the efuses failed\n", __func__); |