Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: ti: fix error return code of ti_iodelay_dt_node_to_map()

when devm_kcalloc fails, use -ENOMEM instead of -EINVAL,
and consistent with other devm_kcalloc return values.

Signed-off-by: Junlin Yang <yangjunlin@yulong.com>
Link: https://lore.kernel.org/r/20210330062655.1027-1-angkery@163.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Junlin Yang and committed by
Linus Walleij
57c855f7 c0dadc0e

+3 -1
+3 -1
drivers/pinctrl/ti/pinctrl-ti-iodelay.c
··· 511 511 } 512 512 513 513 pins = devm_kcalloc(iod->dev, rows, sizeof(*pins), GFP_KERNEL); 514 - if (!pins) 514 + if (!pins) { 515 + error = -ENOMEM; 515 516 goto free_group; 517 + } 516 518 517 519 cfg = devm_kcalloc(iod->dev, rows, sizeof(*cfg), GFP_KERNEL); 518 520 if (!cfg) {