Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ef22892 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: pmic-voter: fix memory leak in create_votable"

parents 9f3261c0 bdd8d351
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -223,11 +223,7 @@ struct votable *create_votable(struct device *dev, const char *name,
					)
{
	int i;
	struct votable *votable = devm_kzalloc(dev, sizeof(struct votable),
							GFP_KERNEL);

	if (!votable)
		return ERR_PTR(-ENOMEM);
	struct votable *votable;

	if (!callback) {
		dev_err(dev, "Invalid callback specified for voter\n");
@@ -244,6 +240,10 @@ struct votable *create_votable(struct device *dev, const char *name,
		return ERR_PTR(-EINVAL);
	}

	votable = devm_kzalloc(dev, sizeof(struct votable), GFP_KERNEL);
	if (!votable)
		return ERR_PTR(-ENOMEM);

	votable->dev = dev;
	votable->name = name;
	votable->num_clients = num_clients;