pinctrl: samsung: Fix samsung_pinctrl_create_functions return value
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 19 Jan 2017 13:48:46 +0000 (14:48 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 26 Jan 2017 09:05:54 +0000 (10:05 +0100)
Return proper error code in case of memory allocation failure.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/samsung/pinctrl-samsung.c

index b11e67e854606ac63ee8e36aaa859a21c65de63d..10b3fd826231394078cde8957f36ff51ce6b0f66 100644 (file)
@@ -751,7 +751,7 @@ static struct samsung_pmx_func *samsung_pinctrl_create_functions(
        functions = devm_kzalloc(dev, func_cnt * sizeof(*functions),
                                        GFP_KERNEL);
        if (!functions)
-               return ERR_PTR(-EINVAL);
+               return ERR_PTR(-ENOMEM);
        func = functions;
 
        /*