Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-2.6-microblaze.git] / drivers / pinctrl / pinctrl-axp209.c
index afd0b53..4fcf726 100644 (file)
@@ -366,6 +366,8 @@ static int axp20x_build_funcs_groups(struct platform_device *pdev)
                pctl->funcs[i].groups = devm_kcalloc(&pdev->dev,
                                                     npins, sizeof(char *),
                                                     GFP_KERNEL);
+               if (!pctl->funcs[i].groups)
+                       return -ENOMEM;
                for (pin = 0; pin < npins; pin++)
                        pctl->funcs[i].groups[pin] = pctl->desc->pins[pin].name;
        }