]> git.baikalelectronics.ru Git - uboot.git/commit
ram: stm32mp1: protect minimum value in get_bufsize
authorPatrick Delaunay <patrick.delaunay@st.com>
Thu, 2 Jul 2020 17:56:34 +0000 (19:56 +0200)
committerPatrick Delaunay <patrick.delaunay@st.com>
Tue, 7 Jul 2020 14:01:23 +0000 (16:01 +0200)
commit4635cbf261490a36ecee9e69369396df7cbf097a
tree825e6ff7b59a09b454da1a50596281a222c01f5b
parent9980d5d90e9195926b9c335f69e1eeb8bc87f36b
ram: stm32mp1: protect minimum value in get_bufsize

Add protection on minimum value for result of get_bufsize
and check the alignment of buffer size: only multiple min_size
is allowed; only 4 bytes alignment was checked previously
(value & 0x3).

For example the "Random" test raises an issue when size is not 8 bytes
aligned because address for buffer = address + size / 2 is not word
aligned.

This patch avoid test error for unsupported size value.

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
drivers/ram/stm32mp1/stm32mp1_tests.c