Unverified Commit f7f80463 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown
Browse files

regulator: rt5133: Fix IS_ERR() vs NULL bug in rt5133_validate_vendor_info()



The "priv->cdata" pointer isn't an error pointer; this should be a NULL
check instead.  Otherwise it leads to a NULL pointer dereference in the
caller, rt5133_probe().

Fixes: 714165e1 ("regulator: rt5133: Add RT5133 PMIC regulator Support")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/aKMc1oK-7yY4cD3K@stanley.mountain


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 550bc517
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -510,7 +510,7 @@ static int rt5133_validate_vendor_info(struct rt5133_priv *priv)
			break;
		}
	}
	if (IS_ERR(priv->cdata)) {
	if (!priv->cdata) {
		dev_err(priv->dev, "Failed to find regulator match version\n");
		return -ENODEV;
	}