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 1/2] mtd: qcom_nandc: Add a NULL check for devm_kasprintf()
Date: Sun, 7 Jan 2018 11:04:59 +0100 [thread overview]
Message-ID: <20180107110459.01beed46@bbrezillon> (raw)
In-Reply-To: <1515182576-2704-1-git-send-email-festevam@gmail.com>
On Fri, 5 Jan 2018 18:02:55 -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.
Applied (also fixed the subject prefix).
Thanks,
Boris
>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---
> drivers/mtd/nand/qcom_nandc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mtd/nand/qcom_nandc.c b/drivers/mtd/nand/qcom_nandc.c
> index 245d0f3..3fe2ff8 100644
> --- a/drivers/mtd/nand/qcom_nandc.c
> +++ b/drivers/mtd/nand/qcom_nandc.c
> @@ -2639,6 +2639,8 @@ static int qcom_nand_host_init(struct qcom_nand_controller *nandc,
>
> nand_set_flash_node(chip, dn);
> mtd->name = devm_kasprintf(dev, GFP_KERNEL, "qcom_nand.%d", host->cs);
> + if (!mtd->name)
> + return -ENOMEM;
> mtd->owner = THIS_MODULE;
> mtd->dev.parent = dev;
>
prev parent reply other threads:[~2018-01-07 10:05 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
2018-01-07 10:04 ` Boris Brezillon [this message]
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=20180107110459.01beed46@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox