pinctrl: ti: fix error return code of ti_iodelay_dt_node_to_map()
Subsystems (2)
PATCH 1/1 pinctrl: ti: fix error return code of ti_iodelay_dt_node_to_map()
From: Junlin Yang <[email protected]>
when devm_kcalloc fails, use -ENOMEM instead of -EINVAL, and consistent with other devm_kcalloc return values.
Signed-off-by Junlin Yang <[email protected]>
--- drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pinctrl/ti/pinctrl-ti-iodelay.c +3 -1
@@ -511,8 +511,10 @@ static int ti_iodelay_dt_node_to_map(struct pinctrl_dev *pctldev, } pins =devm_kcalloc (iod->dev, rows,sizeof (*pins),GFP_KERNEL ); -if (!pins) +if (!pins) { + error = -ENOMEM ; goto free_group; + } cfg =devm_kcalloc (iod->dev, rows,sizeof (*cfg),GFP_KERNEL );if (!cfg) {
Signature · 1 line
1.9.1
Quoted 6 lines · angkery
From: Junlin Yang <[email protected]>
when
devm_kcallocfails, use-ENOMEMinstead of-EINVAL, and consistent with otherdevm_kcallocreturn values.Signed-off-by Junlin Yang <[email protected]>
Patch applied.
Yours,
Linus Walleij