]> git.dujemihanovic.xyz Git - u-boot.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)
commit497e3a89ba46e0f1b1e7772bbd1e1a4c3fff17a5
treed13710d49e6637eb15720294bd276779307f8ddb
parent45a0052939927fbae35e419a7591877c41a06163
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: d7af2baa49c6 ("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