]> git.baikalelectronics.ru Git - uboot.git/commit
dm: core: Correct bad cast in ofnode_get_addr_size_index()
authorSimon Glass <sjg@chromium.org>
Wed, 25 Sep 2019 14:55:50 +0000 (08:55 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Thu, 3 Oct 2019 13:10:53 +0000 (21:10 +0800)
commit8834aa6b47aabc21e5cf79a00ec19daccf5d1cc2
treef29702dda7e243da36e99f9d255d7fe60fce0870
parentb9039f1734e8019e7b7e0d4ab28711c79caa2a71
dm: core: Correct bad cast in ofnode_get_addr_size_index()

At present this code passes an fdt_addr_t pointer as a u64 pointer which
is not safe, since sizeof(fdt_addr_t) may be 4, e.g. with sandbox. Correct
this to avoid a stack corruption problem.

Fixes: 46feee7ce6 (core: ofnode: Add ofnode_get_addr_size_index)
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: correct one typo in the commit message]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
drivers/core/ofnode.c