From: Wentao Liang Date: Tue, 18 Mar 2025 03:07:17 +0000 (+0800) Subject: pinctrl: at91: Add error handling for pinctrl_utils_add_map_mux() X-Git-Tag: v6.16-rc1~113^2~72 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=a63cafe241d2359ed364f3b04e09bafcbada22cc;p=linux-block.git pinctrl: at91: Add error handling for pinctrl_utils_add_map_mux() In atmel_pctl_dt_subnode_to_map(), the return value of pinctrl_utils_add_map_mux() needs to be checked, for the function will fail to associate group when the group map is full. Add error handling for pinctrl_utils_add_map_mux() to return immediately and propagate the error code to caller function when the function fails. Signed-off-by: Wentao Liang Link: https://lore.kernel.org/20250318030717.781-1-vulab@iscas.ac.cn Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index 8b01d312305a..4dcaebc20d99 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c @@ -609,8 +609,10 @@ static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev, if (ret) goto exit; - pinctrl_utils_add_map_mux(pctldev, map, reserved_maps, num_maps, + ret = pinctrl_utils_add_map_mux(pctldev, map, reserved_maps, num_maps, group, func); + if (ret) + goto exit; if (num_configs) { ret = pinctrl_utils_add_map_configs(pctldev, map,