diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2017-09-20 12:43:09 +0530 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-09-21 14:14:17 +0200 |
commit | a5ae5f5cb66633c9ac090055832ce028568b8888 (patch) | |
tree | 5a71e073fb8a7e2c6fcfcf2268d3a659aa73891b /drivers/gpio | |
parent | ba3e217a5761f912c4c887af28020ea861783ce2 (diff) | |
download | linux-stable-a5ae5f5cb66633c9ac090055832ce028568b8888.tar.gz linux-stable-a5ae5f5cb66633c9ac090055832ce028568b8888.tar.bz2 linux-stable-a5ae5f5cb66633c9ac090055832ce028568b8888.zip |
gpio: tb10x: 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>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-tb10x.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-tb10x.c b/drivers/gpio/gpio-tb10x.c index 091ffaaec635..ac6f2a9841e5 100644 --- a/drivers/gpio/gpio-tb10x.c +++ b/drivers/gpio/gpio-tb10x.c @@ -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; |