mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-03 08:04:58 +01:00
pinctrl: berlin: fix error return code of berlin_pinctrl_build_state()
When krealloc() fails and pctrl->functions is NULL, no error return code of berlin_pinctrl_build_state() is assigned. To fix this bug, ret is assigned with -ENOMEM when pctrl->functions is NULL. Signed-off-by: Meng Tang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
1 parent
c0e4c71a9e
commit
de845036f9
1 file changed
+2
@@ -233,6 +233,8 @@ static int berlin_pinctrl_build_state(struct platform_device *pdev)
|
||||
pctrl->functions = krealloc(pctrl->functions,
|
||||
pctrl->nfunctions * sizeof(*pctrl->functions),
|
||||
GFP_KERNEL);
|
||||
if (!pctrl->functions)
|
||||
return -ENOMEM;
|
||||
|
||||
/* map functions to theirs groups */
|
||||
for (i = 0; i < pctrl->desc->ngroups; i++) {
|
||||
|
||||
Reference in new issue
Block a user