regulator: qpnp: fix memory leak when probe failed
This patch fixes the following sparse warnings: qpnp-regulator.c:2187 qpnp_regulator_probe() warn: possible memory leak of 'vreg' Bug: 77543262 Test: boot Change-Id: I115e2c992f37e91fe9b31e7e475619bb679c1ee8 Signed-off-by: David Lin <dtwlin@google.com>
This commit is contained in:
@@ -2184,6 +2184,7 @@ static int qpnp_regulator_probe(struct platform_device *pdev)
|
||||
vreg->regmap = dev_get_regmap(pdev->dev.parent, NULL);
|
||||
if (!vreg->regmap) {
|
||||
dev_err(&pdev->dev, "Couldn't get parent's regmap\n");
|
||||
kfree(vreg);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user