[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200702115659.38208-1-colin.king@canonical.com>
Date: Thu, 2 Jul 2020 12:56:59 +0100
From: Colin King <colin.king@...onical.com>
To: Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Wesley Cheng <wcheng@...eaurora.org>,
linux-arm-msm@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH][next] regulator: fix null pointer check on regmap
From: Colin Ian King <colin.king@...onical.com>
The null pointer check on regmap that checks for a dev_get_regmap failure
is currently returning -ENOENT if the regmap succeeded. Fix this by adding
in the missing ! operator.
Addresses-Coverity: ("Dereference after null check")
Fixes: 4fe66d5a62fb ("regulator: Add support for QCOM PMIC VBUS booster")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
drivers/regulator/qcom_usb_vbus-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/qcom_usb_vbus-regulator.c b/drivers/regulator/qcom_usb_vbus-regulator.c
index 342d92373598..8ba947f3585f 100644
--- a/drivers/regulator/qcom_usb_vbus-regulator.c
+++ b/drivers/regulator/qcom_usb_vbus-regulator.c
@@ -49,7 +49,7 @@ static int qcom_usb_vbus_regulator_probe(struct platform_device *pdev)
}
regmap = dev_get_regmap(dev->parent, NULL);
- if (regmap) {
+ if (!regmap) {
dev_err(dev, "Failed to get regmap\n");
return -ENOENT;
}
--
2.27.0
Powered by blists - more mailing lists