diff options
| author | Dan Carpenter <dan.carpenter@linaro.org> | 2025-08-18 15:30:14 +0300 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-08-19 16:52:47 +0100 |
| commit | f7f804633c91f0fbf03eefbae39eec2205191a82 (patch) | |
| tree | bac2b31793c8dee0e553ee390ae6306444ebbc91 /drivers/regulator | |
| parent | regulator: bd718x7: Use kcalloc() instead of kzalloc() (diff) | |
| download | linux-f7f804633c91f0fbf03eefbae39eec2205191a82.tar.gz linux-f7f804633c91f0fbf03eefbae39eec2205191a82.zip | |
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: 714165e1c4b0 ("regulator: rt5133: Add RT5133 PMIC regulator Support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/aKMc1oK-7yY4cD3K@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
| -rw-r--r-- | drivers/regulator/rt5133-regulator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/rt5133-regulator.c b/drivers/regulator/rt5133-regulator.c index 39532618e73d..129b1f13c880 100644 --- a/drivers/regulator/rt5133-regulator.c +++ b/drivers/regulator/rt5133-regulator.c @@ -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; } |
