From: Mikulas Patocka <mpatocka@redhat.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Alasdair Kergon <agk@redhat.com>,
Mike Snitzer <snitzer@kernel.org>,
dm-devel@redhat.com, Milan Broz <gmazyland@gmail.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] dm integrity: fix error code in dm_integrity_ctr()
Date: Mon, 25 Apr 2022 08:48:27 -0400 (EDT) [thread overview]
Message-ID: <alpine.LRH.2.02.2204250846510.1699@file01.intranet.prod.int.rdu2.redhat.com> (raw)
In-Reply-To: <YmaMgPr8bM/0PFUi@kili>
Thanks for finding it.
On Mon, 25 Apr 2022, Dan Carpenter wrote:
> The "r" variable shadows an earlier "r" that has function scope. It
> means that we accidentally return success instead of an error code.
> Smatch has a warning for this:
>
> drivers/md/dm-integrity.c:4503 dm_integrity_ctr()
> warn: missing error code 'r'
>
> Fixes: 7eada909bfd7 ("dm: add integrity target")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
add:
Cc: stable@vger.kernel.org
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
> ---
> drivers/md/dm-integrity.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
> index 36ae30b73a6e..3d5a0ce123c9 100644
> --- a/drivers/md/dm-integrity.c
> +++ b/drivers/md/dm-integrity.c
> @@ -4494,8 +4494,6 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned argc, char **argv)
> }
>
> if (should_write_sb) {
> - int r;
> -
> init_journal(ic, 0, ic->journal_sections, 0);
> r = dm_integrity_failed(ic);
> if (unlikely(r)) {
> --
> 2.35.1
>
prev parent reply other threads:[~2022-04-25 12:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-25 11:56 [PATCH] dm integrity: fix error code in dm_integrity_ctr() Dan Carpenter
2022-04-25 12:48 ` Mikulas Patocka [this message]
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=alpine.LRH.2.02.2204250846510.1699@file01.intranet.prod.int.rdu2.redhat.com \
--to=mpatocka@redhat.com \
--cc=agk@redhat.com \
--cc=dan.carpenter@oracle.com \
--cc=dm-devel@redhat.com \
--cc=gmazyland@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=snitzer@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).