]> git.baikalelectronics.ru Git - uboot.git/commit
hash: fix a memory leak
authorSergei Antonov <saproj@gmail.com>
Mon, 12 Jun 2023 19:59:10 +0000 (22:59 +0300)
committerTom Rini <trini@konsulko.com>
Fri, 14 Jul 2023 19:21:07 +0000 (15:21 -0400)
commit2e0b381a50fddc8336d6dbc80cbf1507b42cbf71
treed13710d49e6637eb15720294bd276779307f8ddb
parent21e8d8e0039ca76819e2ee2179c58e75a702addd
hash: fix a memory leak

memalign() returns a pointer which is to be freed by free(). To call
unmap_sysmem() is incorrect, furthermore it was called in a wrong scope.

Also add a check for allocation error.

Fixes: b33dbb8714be ("crypto/fsl: Fix HW accelerated hash commands")
Cc: Breno Lima <breno.lima@nxp.com>
Signed-off-by: Sergei Antonov <saproj@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/hash.c