Commit 94462138 authored by Colin Ian King's avatar Colin Ian King Committed by Mark Brown

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: 4fe66d5a ("regulator: Add support for QCOM PMIC VBUS booster")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Dereference after null check")
Link: https://lore.kernel.org/r/20200702115659.38208-1-colin.king@canonical.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent d5ff5fb9
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment