Skip to content

Commit

Permalink
gpio: tb10x: 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 ba3e217 commit a5ae5f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpio/gpio-tb10x.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ static int tb10x_gpio_probe(struct platform_device *pdev)

tb10x_gpio->gc.label =
devm_kasprintf(&pdev->dev, GFP_KERNEL, "%pOF", pdev->dev.of_node);
if (!tb10x_gpio->gc.label)
return -ENOMEM;

tb10x_gpio->gc.parent = &pdev->dev;
tb10x_gpio->gc.owner = THIS_MODULE;
tb10x_gpio->gc.direction_input = tb10x_gpio_direction_in;
Expand Down

0 comments on commit a5ae5f5

Please sign in to comment.