summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-09-21 10:44:13 +0530
committerLinus Walleij <linus.walleij@linaro.org>2017-09-21 14:13:16 +0200
commitba3e217a5761f912c4c887af28020ea861783ce2 (patch)
treef6cba55b74865f13b728c304cad3a4dc6ce994c0
parent6437c7ba69c30a2d3dfd6aa9e8b464c3c4a8cd43 (diff)
downloadlinux-ba3e217a5761f912c4c887af28020ea861783ce2.tar.bz2
gpio: brcmstb: Handle return value of devm_kasprintf
devm_kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/gpio/gpio-brcmstb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
index dd0308cc8bb0..27e92e57adae 100644
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -485,6 +485,10 @@ 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) {
+ err = -ENOMEM;
+ goto fail;
+ }
gc->base = gpio_base;
gc->of_gpio_n_cells = 2;
gc->of_xlate = brcmstb_gpio_of_xlate;