summaryrefslogtreecommitdiff
path: root/cmd/read.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2017-08-15 03:42:27 +0300
committerTom Rini <trini@konsulko.com>2017-08-20 16:54:29 +0300
commit54f1792c8df1dba9cd41d811a7860ddd417f634e (patch)
treea81780b3c33b5851af430e57ea4f5542851c3cbe /cmd/read.c
parent78eda89e9a25810d58dc6df86dbe5d8902cbb90c (diff)
downloadu-boot-54f1792c8df1dba9cd41d811a7860ddd417f634e.tar.xz
mtdparts: Fix various issues reported by Coverity
Now that sandbox is building cmd/mtdparts.c Coverity has looked at the code and found a number of issues. In index_partitions() it is possible that part will be NULL, so re-work the checks and debug statements to take this into account. We have a number of string buffers that we print to in the exact size of, and use string functions on, so we need to ensure they are large enough to be NULL terminated. In device_parse() it is not possible for num_partitions to be 0 (we would have hit a different error first) so remove logically dead code. Finally, in parse_mtdparts() if we have an error we need to free the memory allocated to dev. Cc: Lothar Waßmann <LW@KARO-electronics.de> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Reported-by: Coverity (CID: 166334, 166333, 166332, 166329, 166328) Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'cmd/read.c')
0 files changed, 0 insertions, 0 deletions