From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>,
architt@codeaurora.org, computersforpeace@gmail.com,
linux-mtd@lists.infradead.org, cyrille.pitchen@wedev4u.fr
Subject: Re: [PATCH 2/2] mtd: brcmnand: Add a NULL check for devm_kasprintf()
Date: Sat, 6 Jan 2018 21:40:00 +0100 [thread overview]
Message-ID: <20180106214000.4d75c709@bbrezillon> (raw)
In-Reply-To: <20180106103557.6612a12c@bbrezillon>
On Sat, 6 Jan 2018 10:35:57 +0100
Boris Brezillon <boris.brezillon@free-electrons.com> wrote:
> Hi Fabio,
>
> The prefix should be "mtd: nand: brcmnand: ".
>
> No need to resend, I'll fix it when applying.
>
> Thanks,
>
> Boris
>
> On Fri, 5 Jan 2018 18:02:56 -0200
> Fabio Estevam <festevam@gmail.com> wrote:
>
> > From: Fabio Estevam <fabio.estevam@nxp.com>
> >
> > devm_kasprintf() may fail, so we should better add a NULL check
> > and propagate an error on failure.
> >
> > Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Applied.
Thanks,
Boris
> > ---
> > drivers/mtd/nand/brcmnand/brcmnand.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/mtd/nand/brcmnand/brcmnand.c b/drivers/mtd/nand/brcmnand/brcmnand.c
> > index 3310e14..8942aa6 100644
> > --- a/drivers/mtd/nand/brcmnand/brcmnand.c
> > +++ b/drivers/mtd/nand/brcmnand/brcmnand.c
> > @@ -2237,6 +2237,8 @@ static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn)
> > nand_set_controller_data(chip, host);
> > mtd->name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "brcmnand.%d",
> > host->cs);
> > + if (!mtd->name)
> > + return -ENOMEM;
> > mtd->owner = THIS_MODULE;
> > mtd->dev.parent = &pdev->dev;
> >
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2018-01-06 20:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-05 20:02 [PATCH 1/2] mtd: qcom_nandc: Add a NULL check for devm_kasprintf() Fabio Estevam
2018-01-05 20:02 ` [PATCH 2/2] mtd: brcmnand: " Fabio Estevam
2018-01-06 9:35 ` Boris Brezillon
2018-01-06 20:40 ` Boris Brezillon [this message]
2018-01-07 10:04 ` [PATCH 1/2] mtd: qcom_nandc: " Boris Brezillon
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=20180106214000.4d75c709@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=architt@codeaurora.org \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@wedev4u.fr \
--cc=fabio.estevam@nxp.com \
--cc=festevam@gmail.com \
--cc=linux-mtd@lists.infradead.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 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.