]> git.baikalelectronics.ru Git - uboot.git/commit
malloc_simple: calloc: don't call memset if malloc failed
authorSimon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Thu, 16 Aug 2018 07:50:32 +0000 (09:50 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 24 Aug 2018 17:20:19 +0000 (13:20 -0400)
commit1163355bf48db5fb47fccbe05e331bbb23213fd2
treefe749c4817f565b0f109ac032101d781aad2018b
parentb9c6a8371168d12d420b574ad05156987f0287f9
malloc_simple: calloc: don't call memset if malloc failed

malloc_simple() can return 0 if out of memory. Don't call memset
from calloc() in this case but rely on the caller checking
the return value.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
common/malloc_simple.c