Skip to content

Commit

Permalink
gpio: brcmstb: Handle return value of devm_kasprintf
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arvind Yadav authored and Linus Walleij committed Sep 21, 2017
1 parent 6437c7b commit ba3e217
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpio/gpio-brcmstb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ba3e217

Please sign in to comment.