regulator: rpmh-regulator: fix rpmh_regulator_init_vreg_supply memory leak
Commit 29c41d5c47
("regulator: rpmh-regulator: support parent
supply specification in subnodes") introduced a memory leak in
the function rpmh_regulator_init_vreg_supply() due to 'buf' not
being freed in the new 'else if' statement. Fix this memory leak
by freeing 'buf' correctly.
Change-Id: If2748b595d8ae3a4564a2956a67aeda476975309
Signed-off-by: David Collins <collinsd@codeaurora.org>
This commit is contained in:
parent
1975f8264d
commit
95d95d5a31
@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. */
|
||||
/* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */
|
||||
|
||||
#define pr_fmt(fmt) "%s: " fmt, __func__
|
||||
|
||||
@ -1672,6 +1672,7 @@ static int rpmh_regulator_init_vreg_supply(struct rpmh_vreg *vreg)
|
||||
|
||||
vreg->rdesc.supply_name = buf;
|
||||
} else if (of_find_property(vreg->of_node, "vin-supply", NULL)) {
|
||||
kfree(buf);
|
||||
vreg->rdesc.supply_name = "vin";
|
||||
} else {
|
||||
kfree(buf);
|
||||
|
Loading…
Reference in New Issue
Block a user