From: Dan Carpenter <dan.carpenter@oracle.com>
To: Mark Fasheh <mark@fasheh.com>, Wengang Wang <wen.gang.wang@oracle.com>
Cc: Joel Becker <jlbec@evilplan.org>,
Joseph Qi <joseph.qi@linux.alibaba.com>,
Sunil Mushran <sunil.mushran@oracle.com>,
ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH] ocfs2: fix uninitialized variable in ocfs2_dio_wr_get_block()
Date: Tue, 30 Nov 2021 13:40:43 +0300 [thread overview]
Message-ID: <20211130104043.GB5827@kili> (raw)
The callers assume that "*fsdata" is set on the success path, but
that's not necessarily true on this path.
Fixes: 5cffff9e2986 ("ocfs2: Fix ocfs2_page_mkwrite()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Please review this one EXTRA CAREFULLY. It's from static analysis and
the truth is I'm not 100% sure it's correct. I'm also not sure that
it's a complete fix.
Especially, please review how this is called from ocfs2_write_begin()
to make sure that this doesn't break anything.
fs/ocfs2/aops.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 68d11c295dd3..a74a370f16f0 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -1813,6 +1813,7 @@ int ocfs2_write_begin_nolock(struct address_space *mapping,
if (ret == -EAGAIN) {
BUG_ON(wc->w_target_page);
ret = 0;
+ *fsdata = wc;
goto out_quota;
}
--
2.20.1
next reply other threads:[~2021-11-30 10:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-30 10:40 Dan Carpenter [this message]
2021-12-01 2:24 ` [PATCH] ocfs2: fix uninitialized variable in ocfs2_dio_wr_get_block() Joseph Qi
2021-12-06 6:03 ` Joseph Qi
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=20211130104043.GB5827@kili \
--to=dan.carpenter@oracle.com \
--cc=jlbec@evilplan.org \
--cc=joseph.qi@linux.alibaba.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark@fasheh.com \
--cc=ocfs2-devel@oss.oracle.com \
--cc=sunil.mushran@oracle.com \
--cc=wen.gang.wang@oracle.com \
/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