From: Marek Szyprowski Date: Thu, 19 Jan 2017 13:48:46 +0000 (+0100) Subject: pinctrl: samsung: Fix samsung_pinctrl_create_functions return value X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1f7b8eae5c16e6b16c6467ac8e96d0af9c9de81e;p=openwrt%2Fstaging%2Fblogic.git pinctrl: samsung: Fix samsung_pinctrl_create_functions return value Return proper error code in case of memory allocation failure. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Acked-by: Tomasz Figa Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index b11e67e85460..10b3fd826231 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -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; /*