From 23f25ba6edd4121eb70baf3df12f5592bee8a1e9 Mon Sep 17 00:00:00 2001 From: Rui Miguel Silva Date: Fri, 8 Jan 2016 13:53:44 +0000 Subject: [PATCH] greybus: power_supply: free supplies at release After freeing each individual power_supply, free the top controller, if not it will leak memory at each module insert/remove. Signed-off-by: Rui Miguel Silva Reported-by: Johan Hovold Reviewed-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/power_supply.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/greybus/power_supply.c b/drivers/staging/greybus/power_supply.c index 764d2f640164..7d1848b99d9b 100644 --- a/drivers/staging/greybus/power_supply.c +++ b/drivers/staging/greybus/power_supply.c @@ -579,6 +579,7 @@ static void _gb_power_supplies_release(struct gb_power_supplies *supplies) for (i = 0; i < supplies->supplies_count; i++) _gb_power_supply_release(&supplies->supply[i]); mutex_unlock(&supplies->supplies_lock); + kfree(supplies); } static int gb_power_supplies_get_count(struct gb_power_supplies *supplies) -- 2.20.1