提交 a5ae5f5c 编写于 作者: A Arvind Yadav 提交者: Linus Walleij

gpio: tb10x: Handle return value of devm_kasprintf

devm_kasprintf() can fail here and we must check its return value.
Signed-off-by: NArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 ba3e217a
...@@ -193,6 +193,9 @@ static int tb10x_gpio_probe(struct platform_device *pdev) ...@@ -193,6 +193,9 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
tb10x_gpio->gc.label = tb10x_gpio->gc.label =
devm_kasprintf(&pdev->dev, GFP_KERNEL, "%pOF", pdev->dev.of_node); 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.parent = &pdev->dev;
tb10x_gpio->gc.owner = THIS_MODULE; tb10x_gpio->gc.owner = THIS_MODULE;
tb10x_gpio->gc.direction_input = tb10x_gpio_direction_in; tb10x_gpio->gc.direction_input = tb10x_gpio_direction_in;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册