diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2020-12-25 15:19:39 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-01-20 14:01:45 -0500 |
commit | 81f562719e475b0e13ff7a0201cae19f8cc367fe (patch) | |
tree | 337bc3bf628c133320b5589b5865bb3d64c05bd1 /fs | |
parent | 3b00a6bafc726a9a9df45346fb734d9ecef7b428 (diff) | |
download | u-boot-81f562719e475b0e13ff7a0201cae19f8cc367fe.tar.gz u-boot-81f562719e475b0e13ff7a0201cae19f8cc367fe.tar.xz u-boot-81f562719e475b0e13ff7a0201cae19f8cc367fe.zip |
ubifs: do not decide upon uninitialized variable
Before 'if (err)' we have to initialize the variable otherwise we use a
random value from the stack.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ubifs/io.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c index eb14b89544..9962cbe7eb 100644 --- a/fs/ubifs/io.c +++ b/fs/ubifs/io.c @@ -114,7 +114,7 @@ int ubifs_leb_read(const struct ubifs_info *c, int lnum, void *buf, int offs, int ubifs_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs, int len) { - int err; + int err = 0; ubifs_assert(!c->ro_media && !c->ro_mount); if (c->ro_error) @@ -136,7 +136,7 @@ int ubifs_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs, int ubifs_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len) { - int err; + int err = 0; ubifs_assert(!c->ro_media && !c->ro_mount); if (c->ro_error) @@ -158,7 +158,7 @@ int ubifs_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len) int ubifs_leb_unmap(struct ubifs_info *c, int lnum) { - int err; + int err = 0; ubifs_assert(!c->ro_media && !c->ro_mount); if (c->ro_error) @@ -179,7 +179,7 @@ int ubifs_leb_unmap(struct ubifs_info *c, int lnum) int ubifs_leb_map(struct ubifs_info *c, int lnum) { - int err; + int err = 0; ubifs_assert(!c->ro_media && !c->ro_mount); if (c->ro_error) |