]> git.baikalelectronics.ru Git - uboot.git/commit
cmd/gpt.c, cmd/nvedit.c, tools/fit_image.c: Rework recent fixes for Coverity
authorTom Rini <trini@konsulko.com>
Sat, 7 Oct 2017 15:27:59 +0000 (11:27 -0400)
committerTom Rini <trini@konsulko.com>
Sat, 7 Oct 2017 15:27:59 +0000 (11:27 -0400)
commit28330c149e9758b38833a79cf09702a6781712a0
treececa9d544b473499e659bd04c77432dac29df0ae
parent6588e0d1d3ddf7bab4b19f5a690d4c2c072769f3
cmd/gpt.c, cmd/nvedit.c, tools/fit_image.c: Rework recent fixes for Coverity

The recent changes to these files did not completely fix the previous
issues, or introduced different (minor) issues.  In cmd/gpt.c we need to
dereference str_disk_guid to be sure that malloc worked.  In
cmd/nvedit.c we need to be careful that we can also fit in that leading
space when adding to the string.  And in tools/fit_image.c we need to
re-work the error handling slightly in fit_import_data() so that we only
call munmap() once.  We have two error paths here, one where we have an
fd to close and one where we do not.  Adjust labels to match this.

Reported-by: Coverity (CID: 167366, 167367, 167370)
Signed-off-by: Tom Rini <trini@konsulko.com>
cmd/gpt.c
cmd/nvedit.c
tools/fit_image.c