summaryrefslogtreecommitdiff
path: root/drivers/regulator/qcom_usb_vbus-regulator.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2020-07-02 14:56:59 +0300
committerMark Brown <broonie@kernel.org>2020-07-02 18:45:45 +0300
commit94462138f368a5e079d53d578509276e4366d0c1 (patch)
tree9c65801da5fd4cefba74b5e99f2273ff3e72e547 /drivers/regulator/qcom_usb_vbus-regulator.c
parentd5ff5fb977f0c3d07bdb9f87b490c70481c8666f (diff)
downloadlinux-94462138f368a5e079d53d578509276e4366d0c1.tar.xz
regulator: fix null pointer check on regmap
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. Fixes: 4fe66d5a62fb ("regulator: Add support for QCOM PMIC VBUS booster") Signed-off-by: Colin Ian King <colin.king@canonical.com> Addresses-Coverity: ("Dereference after null check") Link: https://lore.kernel.org/r/20200702115659.38208-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/qcom_usb_vbus-regulator.c')
-rw-r--r--drivers/regulator/qcom_usb_vbus-regulator.c2
1 files changed, 1 insertions, 1 deletions
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;
}