* [PATCH] mtd: nand: fix return value in nand_erase_nand()
@ 2018-03-21 8:10 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2018-03-21 8:10 UTC (permalink / raw)
To: Boris Brezillon
Cc: Richard Weinberger, David Woodhouse, Brian Norris, Marek Vasut,
Cyrille Pitchen, Masahiro Yamada, Miquel Raynal, linux-mtd,
kernel-janitors
The problem is that "ret" isn't initialized on the success path.
Fixes: cc4ac09da649 ("mtd: Stop updating erase_info->state and calling mtd_erase_callback()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 13dd67106859..87b72bf626ae 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -4653,6 +4653,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
}
}
+ ret = 0;
erase_exit:
/* Deselect and wake up anyone waiting on the device */
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] mtd: nand: fix return value in nand_erase_nand()
@ 2018-03-21 8:10 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2018-03-21 8:10 UTC (permalink / raw)
To: Boris Brezillon
Cc: Richard Weinberger, David Woodhouse, Brian Norris, Marek Vasut,
Cyrille Pitchen, Masahiro Yamada, Miquel Raynal, linux-mtd,
kernel-janitors
The problem is that "ret" isn't initialized on the success path.
Fixes: cc4ac09da649 ("mtd: Stop updating erase_info->state and calling mtd_erase_callback()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 13dd67106859..87b72bf626ae 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -4653,6 +4653,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
}
}
+ ret = 0;
erase_exit:
/* Deselect and wake up anyone waiting on the device */
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: nand: fix return value in nand_erase_nand()
2018-03-21 8:10 ` Dan Carpenter
@ 2018-03-21 9:03 ` Boris Brezillon
-1 siblings, 0 replies; 4+ messages in thread
From: Boris Brezillon @ 2018-03-21 9:03 UTC (permalink / raw)
To: Dan Carpenter
Cc: Richard Weinberger, David Woodhouse, Brian Norris, Marek Vasut,
Cyrille Pitchen, Masahiro Yamada, Miquel Raynal, linux-mtd,
kernel-janitors
Hi Dan,
On Wed, 21 Mar 2018 11:10:14 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The problem is that "ret" isn't initialized on the success path.
>
> Fixes: cc4ac09da649 ("mtd: Stop updating erase_info->state and calling mtd_erase_callback()")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
I squashed those changes into the offending commit.
As usual, thanks for this report (and fix).
Boris
>
> diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
> index 13dd67106859..87b72bf626ae 100644
> --- a/drivers/mtd/nand/raw/nand_base.c
> +++ b/drivers/mtd/nand/raw/nand_base.c
> @@ -4653,6 +4653,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
> }
> }
>
> + ret = 0;
> erase_exit:
>
> /* Deselect and wake up anyone waiting on the device */
--
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: nand: fix return value in nand_erase_nand()
@ 2018-03-21 9:03 ` Boris Brezillon
0 siblings, 0 replies; 4+ messages in thread
From: Boris Brezillon @ 2018-03-21 9:03 UTC (permalink / raw)
To: Dan Carpenter
Cc: Richard Weinberger, David Woodhouse, Brian Norris, Marek Vasut,
Cyrille Pitchen, Masahiro Yamada, Miquel Raynal, linux-mtd,
kernel-janitors
Hi Dan,
On Wed, 21 Mar 2018 11:10:14 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The problem is that "ret" isn't initialized on the success path.
>
> Fixes: cc4ac09da649 ("mtd: Stop updating erase_info->state and calling mtd_erase_callback()")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
I squashed those changes into the offending commit.
As usual, thanks for this report (and fix).
Boris
>
> diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
> index 13dd67106859..87b72bf626ae 100644
> --- a/drivers/mtd/nand/raw/nand_base.c
> +++ b/drivers/mtd/nand/raw/nand_base.c
> @@ -4653,6 +4653,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
> }
> }
>
> + ret = 0;
> erase_exit:
>
> /* Deselect and wake up anyone waiting on the device */
--
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-03-21 9:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-21 8:10 [PATCH] mtd: nand: fix return value in nand_erase_nand() Dan Carpenter
2018-03-21 8:10 ` Dan Carpenter
2018-03-21 9:03 ` Boris Brezillon
2018-03-21 9:03 ` Boris Brezillon
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.