* [dm-devel] [PATCH] dm integrity: fix error code in dm_integrity_ctr()
@ 2022-04-25 11:56 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2022-04-25 11:56 UTC (permalink / raw)
To: Alasdair Kergon, Mikulas Patocka
Cc: kernel-janitors, dm-devel, Mike Snitzer, Milan Broz, linux-kernel
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>
---
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
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] dm integrity: fix error code in dm_integrity_ctr()
@ 2022-04-25 11:56 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2022-04-25 11:56 UTC (permalink / raw)
To: Alasdair Kergon, Mikulas Patocka
Cc: Mike Snitzer, dm-devel, Milan Broz, linux-kernel, kernel-janitors
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>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [dm-devel] [PATCH] dm integrity: fix error code in dm_integrity_ctr()
2022-04-25 11:56 ` Dan Carpenter
@ 2022-04-25 12:48 ` Mikulas Patocka
-1 siblings, 0 replies; 4+ messages in thread
From: Mikulas Patocka @ 2022-04-25 12:48 UTC (permalink / raw)
To: Dan Carpenter
Cc: Mike Snitzer, kernel-janitors, linux-kernel, dm-devel, Milan Broz,
Alasdair Kergon
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
>
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dm integrity: fix error code in dm_integrity_ctr()
@ 2022-04-25 12:48 ` Mikulas Patocka
0 siblings, 0 replies; 4+ messages in thread
From: Mikulas Patocka @ 2022-04-25 12:48 UTC (permalink / raw)
To: Dan Carpenter
Cc: Alasdair Kergon, Mike Snitzer, dm-devel, Milan Broz, linux-kernel,
kernel-janitors
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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-25 12:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-25 11:56 [dm-devel] [PATCH] dm integrity: fix error code in dm_integrity_ctr() Dan Carpenter
2022-04-25 11:56 ` Dan Carpenter
2022-04-25 12:48 ` [dm-devel] " Mikulas Patocka
2022-04-25 12:48 ` Mikulas Patocka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.