From: Colin King <colin.king@canonical.com>
To: Alasdair Kergon <agk@redhat.com>,
Mike Snitzer <snitzer@redhat.com>,
dm-devel@redhat.com
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH][next] dm writecache: fix missing goto in error handling code
Date: Sun, 27 May 2018 23:25:12 +0100 [thread overview]
Message-ID: <20180527222512.25280-1-colin.king@canonical.com> (raw)
From: Colin Ian King <colin.king@canonical.com>
Currently, the -EFBIG error condition when n_bitmaps_bits is
too large is falling through to the next statement and the
error assignment to r is potentially being ignored. The code
should be exiting to the error path via label 'bad'. Fix
this by adding the missing goto statement.
Detected by CoverityScan, CID#1469377 ("Unused value")
Fixes: bb15b431d650 ("dm: add writecache target")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/md/dm-writecache.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index 1ef06e738eb6..e61704b6eae1 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -2077,6 +2077,7 @@ static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv)
if (n_bitmap_bits > 1U << 31) {
r = -EFBIG;
ti->error = "Invalid device size";
+ goto bad;
}
wc->memory_map = vmalloc(n_metadata_blocks << wc->block_size_bits);
--
2.17.0
next reply other threads:[~2018-05-27 22:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-27 22:25 Colin King [this message]
2018-05-29 18:09 ` Mike Snitzer
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=20180527222512.25280-1-colin.king@canonical.com \
--to=colin.king@canonical.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=snitzer@redhat.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
all inboxes | Powered by JetHome®