Skip to content

Commit ba3e217

Browse files
ArvindYadavCslinusw
authored andcommitted
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 <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 6437c7b commit ba3e217

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpio/gpio-brcmstb.c

+4
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,10 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
485485
gc->of_node = np;
486486
gc->owner = THIS_MODULE;
487487
gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", dev->of_node);
488+
if (!gc->label) {
489+
err = -ENOMEM;
490+
goto fail;
491+
}
488492
gc->base = gpio_base;
489493
gc->of_gpio_n_cells = 2;
490494
gc->of_xlate = brcmstb_gpio_of_xlate;

0 commit comments

Comments
 (0)