From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
"David Woodhouse" <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Marek Vasut <marek.vasut@gmail.com>,
Peter Pan <peterpandong@micron.com>,
Frieder Schrempf <frieder.schrempf@exceet.de>,
<linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH -next] mtd: spinand: Fix error return code in spinand_init()
Date: Wed, 4 Jul 2018 10:28:29 +0200 [thread overview]
Message-ID: <20180704102829.6b29c6cb@bbrezillon> (raw)
In-Reply-To: <1530693298-14271-1-git-send-email-weiyongjun1@huawei.com>
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);
>
next prev parent reply other threads:[~2018-07-04 8:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-04 8:34 [PATCH -next] mtd: spinand: Fix error return code in spinand_init() Wei Yongjun
2018-07-04 8:28 ` Boris Brezillon [this message]
2018-07-08 21:49 ` Miquel Raynal
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=20180704102829.6b29c6cb@bbrezillon \
--to=boris.brezillon@bootlin.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=frieder.schrempf@exceet.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=peterpandong@micron.com \
--cc=richard@nod.at \
--cc=weiyongjun1@huawei.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;
as well as URLs for NNTP newsgroup(s).