From: Dan Carpenter <dan.carpenter@oracle.com>
To: Richard Weinberger <richard@nod.at>, David Gstir <david@sigma-star.at>
Cc: Artem Bityutskiy <dedekind1@gmail.com>,
Adrian Hunter <adrian.hunter@intel.com>,
linux-mtd@lists.infradead.org, kernel-janitors@vger.kernel.org
Subject: [patch] ubifs: potential uninitialized variable in truncate_data_node()
Date: Thu, 5 Jan 2017 15:46:35 +0300 [thread overview]
Message-ID: <20170105124635.GA8525@elgon.mountain> (raw)
GCC doesn't complain, but my static checker warns that if the data is
not compressed and not encrypted then "ret" isn't initialized.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
index a459211a1c21..c54f04d88236 100644
--- a/fs/ubifs/journal.c
+++ b/fs/ubifs/journal.c
@@ -1281,7 +1281,8 @@ static int truncate_data_node(const struct ubifs_info *c, const struct inode *in
int *new_len)
{
void *buf;
- int err, dlen, compr_type, out_len, old_dlen;
+ int dlen, compr_type, out_len, old_dlen;
+ int err = 0;
out_len = le32_to_cpu(dn->size);
buf = kmalloc(out_len * WORST_COMPR_FACTOR, GFP_NOFS);
next reply other threads:[~2017-01-05 12:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-05 12:46 Dan Carpenter [this message]
2017-01-05 12:54 ` [patch] ubifs: potential uninitialized variable in truncate_data_node() Anurag Raghavan (RBEI/ETW11)
2017-01-05 13:12 ` Richard Weinberger
2017-01-05 13:22 ` Anurag Raghavan (RBEI/ETW11)
2017-01-06 5:18 ` Anurag Raghavan (RBEI/ETW11)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170105124635.GA8525@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=adrian.hunter@intel.com \
--cc=david@sigma-star.at \
--cc=dedekind1@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox