mirror of
https://github.com/u-boot/u-boot.git
synced 2025-01-22 18:54:08 +08:00
mtdparts: Fix uninitialized scalar usage
When reworking this code to fix other issues found by Coverity, I forgot
to ensure tmp_ep was always cleared before use.
Reported-by: Coverity (CID: 166612)
Fixes: bc028345ac
("mtdparts: Fix final outstanding issue reported by Coverity")
Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
bd95e655b2
commit
8b3cec7da1
@ -1751,6 +1751,7 @@ int mtdparts_init(void)
|
||||
/* save it for later parsing, cannot rely on current partition pointer
|
||||
* as 'partition' variable may be updated during init */
|
||||
memset(tmp_parts, 0, sizeof(tmp_parts));
|
||||
memset(tmp_ep, 0, sizeof(tmp_ep));
|
||||
if (current_partition)
|
||||
strncpy(tmp_ep, current_partition, PARTITION_MAXLEN);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user