[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240804130916.37153-1-m.lobanov@rosalinux.ru>
Date: Sun, 4 Aug 2024 09:08:50 -0400
From: Mikhail Lobanov <m.lobanov@...alinux.ru>
To: Chanwoo Choi <cw00.choi@...sung.com>
Cc: Mikhail Lobanov <m.lobanov@...alinux.ru>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
MyungJoo Ham <myungjoo.ham@...sung.com>,
linux-kernel@...r.kernel.org,
lvc-project@...uxtesting.org
Subject: [PATCH] extcon: checking the function return code
This patch adds error handling for the return value of the max77693_muic_set_path function within
the max77693_muic_probe function. The return value is checked to ensure that any error returned by
max77693_muic_set_path is properly handled. If the function call fails, an error message is logged
and the probe function returns the error code.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 2b75799f5ae9 ("extcon: max77693: Set default uart/usb path by using platform data")
Signed-off-by: Mikhail Lobanov <m.lobanov@...alinux.ru>
---
drivers/extcon/extcon-max77693.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index 2c567e0b7b7f..6a2fec47f2f1 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -1228,9 +1228,13 @@ static int max77693_muic_probe(struct platform_device *pdev)
cable_type = max77693_muic_get_cable_type(info,
MAX77693_CABLE_GROUP_ADC, &attached);
if (attached && (cable_type == MAX77693_MUIC_ADC_FACTORY_MODE_UART_ON ||
- cable_type == MAX77693_MUIC_ADC_FACTORY_MODE_UART_OFF))
- max77693_muic_set_path(info, info->path_uart, true);
-
+ cable_type == MAX77693_MUIC_ADC_FACTORY_MODE_UART_OFF)) {
+ ret = max77693_muic_set_path(info, info->path_uart, true);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "failed to set path for UART: %d\n", ret);
+ return ret;
+ }
+ }
/* Check revision number of MUIC device*/
ret = regmap_read(info->max77693->regmap_muic,
MAX77693_MUIC_REG_ID, &id);
--
2.43.0
Powered by blists - more mailing lists