]> git.baikalelectronics.ru Git - uboot.git/commit
cmd/gpt: Address error cases during gpt rename more correctly
authorTom Rini <trini@konsulko.com>
Tue, 21 Jan 2020 16:53:38 +0000 (11:53 -0500)
committerTom Rini <trini@konsulko.com>
Thu, 30 Jan 2020 18:30:35 +0000 (13:30 -0500)
commitd6577fd8bc411a71bd2a27ed1459dfd6ca5513ae
treed92ce80d2c27e3ded3a7a75133715602cbbbabb1
parent474690d40c4ef7fe0d3a70bb3aa901c09b80d9d3
cmd/gpt: Address error cases during gpt rename more correctly

New analysis by the tool has shown that we have some cases where we
weren't handling the error exit condition correctly.  When we ran into
the ENOMEM case we wouldn't exit the function and thus incorrect things
could happen.  Rework the unwinding such that we don't need a helper
function now and free what we may have allocated.

Fixes: d57899ecf2b8 ("GPT: fix memory leaks identified by Coverity")
Reported-by: Coverity (CID: 275475, 275476)
Cc: Alison Chaiken <alison@she-devel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Jordy <jordy@simplyhacker.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
cmd/gpt.c