Skip to content

Commit f7f8046

Browse files
Dan Carpenterbroonie
authored andcommitted
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: 714165e ("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>
1 parent 550bc51 commit f7f8046

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/regulator/rt5133-regulator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ static int rt5133_validate_vendor_info(struct rt5133_priv *priv)
510510
break;
511511
}
512512
}
513-
if (IS_ERR(priv->cdata)) {
513+
if (!priv->cdata) {
514514
dev_err(priv->dev, "Failed to find regulator match version\n");
515515
return -ENODEV;
516516
}

0 commit comments

Comments
 (0)