* Re: [PATCH -next] mtd: spinand: Fix error return code in spinand_init()
2018-07-04 8:34 ` Wei Yongjun
@ 2018-07-04 8:28 ` Boris Brezillon
-1 siblings, 0 replies; 6+ messages in thread
From: Boris Brezillon @ 2018-07-04 8:28 UTC (permalink / raw)
To: Wei Yongjun
Cc: Miquel Raynal, Richard Weinberger, David Woodhouse, Brian Norris,
Marek Vasut, Peter Pan, Frieder Schrempf, linux-mtd,
linux-kernel, kernel-janitors
On Wed, 4 Jul 2018 08:34:58 +0000
Wei Yongjun <weiyongjun1@huawei.com> wrote:
> Fix to return error code -ENOMEM from the kzalloc() error handling
> case instead of 0, as done elsewhere in this function.
>
> Fixes: c898e0526fb6 ("mtd: nand: Add core infrastructure to support SPI NANDs")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Boris Brezillon <boris.brezillon@bootlin.com>
> ---
> drivers/mtd/nand/spi/core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index 17d207a..011683e 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -985,8 +985,10 @@ static int spinand_init(struct spinand_device *spinand)
> spinand->databuf = kzalloc(nanddev_page_size(nand) +
> nanddev_per_page_oobsize(nand),
> GFP_KERNEL);
> - if (!spinand->databuf)
> + if (!spinand->databuf) {
> + ret = -ENOMEM;
> goto err_free_bufs;
> + }
>
> spinand->oobbuf = spinand->databuf + nanddev_page_size(nand);
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mtd: spinand: Fix error return code in spinand_init()
@ 2018-07-04 8:28 ` Boris Brezillon
0 siblings, 0 replies; 6+ messages in thread
From: Boris Brezillon @ 2018-07-04 8:28 UTC (permalink / raw)
To: Wei Yongjun
Cc: Miquel Raynal, Richard Weinberger, David Woodhouse, Brian Norris,
Marek Vasut, Peter Pan, Frieder Schrempf, linux-mtd,
linux-kernel, kernel-janitors
On Wed, 4 Jul 2018 08:34:58 +0000
Wei Yongjun <weiyongjun1@huawei.com> wrote:
> Fix to return error code -ENOMEM from the kzalloc() error handling
> case instead of 0, as done elsewhere in this function.
>
> Fixes: c898e0526fb6 ("mtd: nand: Add core infrastructure to support SPI NANDs")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Boris Brezillon <boris.brezillon@bootlin.com>
> ---
> drivers/mtd/nand/spi/core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index 17d207a..011683e 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -985,8 +985,10 @@ static int spinand_init(struct spinand_device *spinand)
> spinand->databuf = kzalloc(nanddev_page_size(nand) +
> nanddev_per_page_oobsize(nand),
> GFP_KERNEL);
> - if (!spinand->databuf)
> + if (!spinand->databuf) {
> + ret = -ENOMEM;
> goto err_free_bufs;
> + }
>
> spinand->oobbuf = spinand->databuf + nanddev_page_size(nand);
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH -next] mtd: spinand: Fix error return code in spinand_init()
2018-07-04 8:28 ` Boris Brezillon
@ 2018-07-04 8:34 ` Wei Yongjun
-1 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2018-07-04 8:34 UTC (permalink / raw)
To: Boris Brezillon, Miquel Raynal, Richard Weinberger,
David Woodhouse, Brian Norris, Marek Vasut, Peter Pan,
Frieder Schrempf
Cc: Wei Yongjun, linux-mtd, linux-kernel, kernel-janitors
Fix to return error code -ENOMEM from the kzalloc() error handling
case instead of 0, as done elsewhere in this function.
Fixes: c898e0526fb6 ("mtd: nand: Add core infrastructure to support SPI NANDs")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/mtd/nand/spi/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 17d207a..011683e 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -985,8 +985,10 @@ static int spinand_init(struct spinand_device *spinand)
spinand->databuf = kzalloc(nanddev_page_size(nand) +
nanddev_per_page_oobsize(nand),
GFP_KERNEL);
- if (!spinand->databuf)
+ if (!spinand->databuf) {
+ ret = -ENOMEM;
goto err_free_bufs;
+ }
spinand->oobbuf = spinand->databuf + nanddev_page_size(nand);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH -next] mtd: spinand: Fix error return code in spinand_init()
@ 2018-07-04 8:34 ` Wei Yongjun
0 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2018-07-04 8:34 UTC (permalink / raw)
To: Boris Brezillon, Miquel Raynal, Richard Weinberger,
David Woodhouse, Brian Norris, Marek Vasut, Peter Pan,
Frieder Schrempf
Cc: Wei Yongjun, linux-mtd, linux-kernel, kernel-janitors
Fix to return error code -ENOMEM from the kzalloc() error handling
case instead of 0, as done elsewhere in this function.
Fixes: c898e0526fb6 ("mtd: nand: Add core infrastructure to support SPI NANDs")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/mtd/nand/spi/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 17d207a..011683e 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -985,8 +985,10 @@ static int spinand_init(struct spinand_device *spinand)
spinand->databuf = kzalloc(nanddev_page_size(nand) +
nanddev_per_page_oobsize(nand),
GFP_KERNEL);
- if (!spinand->databuf)
+ if (!spinand->databuf) {
+ ret = -ENOMEM;
goto err_free_bufs;
+ }
spinand->oobbuf = spinand->databuf + nanddev_page_size(nand);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mtd: spinand: Fix error return code in spinand_init()
2018-07-04 8:34 ` Wei Yongjun
@ 2018-07-08 21:49 ` Miquel Raynal
-1 siblings, 0 replies; 6+ messages in thread
From: Miquel Raynal @ 2018-07-08 21:49 UTC (permalink / raw)
To: Wei Yongjun
Cc: Boris Brezillon, Richard Weinberger, David Woodhouse,
Brian Norris, Marek Vasut, Peter Pan, Frieder Schrempf,
linux-mtd, linux-kernel, kernel-janitors
Hi Wei,
Wei Yongjun <weiyongjun1@huawei.com> wrote on Wed, 4 Jul 2018 08:34:58
+0000:
> Fix to return error code -ENOMEM from the kzalloc() error handling
> case instead of 0, as done elsewhere in this function.
>
> Fixes: c898e0526fb6 ("mtd: nand: Add core infrastructure to support SPI NANDs")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/mtd/nand/spi/core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Merged with the original commit.
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] mtd: spinand: Fix error return code in spinand_init()
@ 2018-07-08 21:49 ` Miquel Raynal
0 siblings, 0 replies; 6+ messages in thread
From: Miquel Raynal @ 2018-07-08 21:49 UTC (permalink / raw)
To: Wei Yongjun
Cc: Boris Brezillon, Richard Weinberger, David Woodhouse,
Brian Norris, Marek Vasut, Peter Pan, Frieder Schrempf,
linux-mtd, linux-kernel, kernel-janitors
Hi Wei,
Wei Yongjun <weiyongjun1@huawei.com> wrote on Wed, 4 Jul 2018 08:34:58
+0000:
> Fix to return error code -ENOMEM from the kzalloc() error handling
> case instead of 0, as done elsewhere in this function.
>
> Fixes: c898e0526fb6 ("mtd: nand: Add core infrastructure to support SPI NANDs")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/mtd/nand/spi/core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Merged with the original commit.
Thanks,
Miquèl
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-07-08 21:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-04 8:34 [PATCH -next] mtd: spinand: Fix error return code in spinand_init() Wei Yongjun
2018-07-04 8:34 ` Wei Yongjun
2018-07-04 8:28 ` Boris Brezillon
2018-07-04 8:28 ` Boris Brezillon
2018-07-08 21:49 ` Miquel Raynal
2018-07-08 21:49 ` Miquel Raynal
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.