Fix cases where memory is allocated using malloc()

arch/arm/src/cxd56xx/cxd56_gnss.c, arch/arm/src/xmc4/xmc4_spi.c,
 crypto/blake2s.c, drivers/lcd/pcf8574_lcd_backpack.c, drivers/lcd/st7032.c

User space memory should not be used within the OS and, when it is absolutely necessary to use user-space memory, it should be allocated using kumm_malloc().
This commit is contained in:
Gregory Nutt
2020-08-04 11:29:52 -06:00
committed by Abdelatif Guettouche
parent 3cad9f498f
commit 2dae970ec6
5 changed files with 28 additions and 22 deletions
+3 -2
View File
@@ -52,6 +52,7 @@
#include <assert.h>
#include <errno.h>
#include <nuttx/kmalloc.h>
#include <nuttx/crypto/blake2s.h>
/****************************************************************************
@@ -330,7 +331,7 @@ static int blake2s_selftest(void)
blake2s_state ctx;
int ret = -1;
in = malloc(1024);
in = kmm_malloc(1024);
if (!in)
{
goto out;
@@ -372,7 +373,7 @@ static int blake2s_selftest(void)
ret = 0;
out:
free(in);
kmm_free(in);
return ret;
}
#endif