[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <9c8c5c337a9351a561a4bf18f2faa1e9a01b50e6.1572884515.git.jsarha@ti.com>
Date: Mon, 4 Nov 2019 18:24:15 +0200
From: Jyri Sarha <jsarha@...com>
To: <p.zabel@...gutronix.de>, <linux-kernel@...r.kernel.org>
CC: <tomi.valkeinen@...com>, <colin.king@...onical.com>,
<treding@...dia.com>
Subject: [PATCH] reset: Free struct reset_control_array in reset_control_array_put()
Fix memory leak in devm_reset_control_array_get(). Free also the
struct reset_control_array pointer in reset_control_array_put() not
only the reset-controls stored in it.
Reported-by: Tomi Valkeinen <tomi.valkeinen@...com>
Signed-off-by: Jyri Sarha <jsarha@...com>
---
drivers/reset/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/reset/core.c b/drivers/reset/core.c
index 213ff40dda11..85d9676ee969 100644
--- a/drivers/reset/core.c
+++ b/drivers/reset/core.c
@@ -748,6 +748,8 @@ static void reset_control_array_put(struct reset_control_array *resets)
for (i = 0; i < resets->num_rstcs; i++)
__reset_control_put_internal(resets->rstc[i]);
mutex_unlock(&reset_list_mutex);
+
+ kfree(resets);
}
/**
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Powered by blists - more mailing lists