summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/realtek
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2023-10-07 00:04:19 +0300
committerLinus Walleij <linus.walleij@linaro.org>2023-10-07 00:11:32 +0300
commit0aa5369fdb9ee5910a369c321b1c519d49592678 (patch)
tree8670123c9664f93ee5613e5320bfed7ee23a2982 /drivers/pinctrl/realtek
parentd48f8a6f4a204d679819d6147e9933695f3bee32 (diff)
downloadlinux-0aa5369fdb9ee5910a369c321b1c519d49592678.tar.xz
pinctrl: realtek: Fix some NULL dereference warnings
Just inspecting the code doesn't convince me that this is a real issue, but the tools complain that it is so I will just handle it. Cc: Tzuyi Chang <tychang@realtek.com> Link: https://lore.kernel.org/oe-kbuild-all/202309270234.aJGlDE0P-lkp@intel.com/ Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20231006-fix-realtek-warnings-v1-2-09af253312ba@linaro.org
Diffstat (limited to 'drivers/pinctrl/realtek')
-rw-r--r--drivers/pinctrl/realtek/pinctrl-rtd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/pinctrl/realtek/pinctrl-rtd.c b/drivers/pinctrl/realtek/pinctrl-rtd.c
index 6c6aa9c3c567..9c7a1af4ba69 100644
--- a/drivers/pinctrl/realtek/pinctrl-rtd.c
+++ b/drivers/pinctrl/realtek/pinctrl-rtd.c
@@ -165,7 +165,10 @@ static int rtd_pinctrl_set_one_mux(struct pinctrl_dev *pcdev,
return 0;
if (!mux->functions) {
- dev_err(pcdev->dev, "No functions available for pin %s\n", mux->name);
+ if (!mux->name)
+ dev_err(pcdev->dev, "NULL pin has no functions\n");
+ else
+ dev_err(pcdev->dev, "No functions available for pin %s\n", mux->name);
return -ENOTSUPP;
}
@@ -177,6 +180,11 @@ static int rtd_pinctrl_set_one_mux(struct pinctrl_dev *pcdev,
return ret;
}
+ if (!mux->name) {
+ dev_err(pcdev->dev, "NULL pin provided for function %s\n", func_name);
+ return -EINVAL;
+ }
+
dev_err(pcdev->dev, "No function %s available for pin %s\n", func_name, mux->name);
return -EINVAL;