From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: gregory.0xf0@gmail.com, linus.walleij@linaro.org,
computersforpeace@gmail.com, f.fainelli@gmail.com
Cc: bcm-kernel-feedback-list@broadcom.com,
linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] gpio: brcmstb: Handle return value of devm_kasprintf
Date: Wed, 20 Sep 2017 12:43:08 +0530 [thread overview]
Message-ID: <1505891589-6632-2-git-send-email-arvind.yadav.cs@gmail.com> (raw)
In-Reply-To: <1505891589-6632-1-git-send-email-arvind.yadav.cs@gmail.com>
devm_kasprintf() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/gpio/gpio-brcmstb.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
index dd0308c..1227d6e 100644
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -485,6 +485,9 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
gc->of_node = np;
gc->owner = THIS_MODULE;
gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", dev->of_node);
+ if (!gc->label)
+ goto fail;
+
gc->base = gpio_base;
gc->of_gpio_n_cells = 2;
gc->of_xlate = brcmstb_gpio_of_xlate;
--
1.9.1
next prev parent reply other threads:[~2017-09-20 7:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-20 7:13 [PATCH 0/2] Handle return value of devm_kasprintf Arvind Yadav
2017-09-20 7:13 ` Arvind Yadav [this message]
2017-09-21 3:24 ` [PATCH 1/2] gpio: brcmstb: " Gregory Fong
2017-09-20 7:13 ` [PATCH 2/2] gpio: tb10x: " Arvind Yadav
2017-09-21 12:14 ` Linus Walleij
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=1505891589-6632-2-git-send-email-arvind.yadav.cs@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=computersforpeace@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=gregory.0xf0@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).