]> git.dujemihanovic.xyz Git - u-boot.git/commit
spi: Avoid using malloc() in a critical function
authorSimon Glass <sjg@chromium.org>
Sat, 18 May 2019 17:59:54 +0000 (11:59 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 10 Jul 2019 22:52:58 +0000 (16:52 -0600)
commitca2abb75a086d8b0bdb51689f331ba8f1a146379
treee6afa389d92309be6d002a4eec41a59d7f2b3e66
parent731ba3c0beaf4318cc97ece1e422a61fc5721f5b
spi: Avoid using malloc() in a critical function

In general we should avoid calling malloc() and free() repeatedly in
U-Boot lest we turn it into tianocore. In SPL this can make SPI flash
unusable since free() is often a nop and allocation space is limited.

In any case, these seems no need for malloc() since the number of bytes
is very small, perhaps less than 8.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: d13f5b254a (spi: Extend the core to ease integration of SPI
memory controllers)
drivers/spi/spi-mem.c