[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210610152925.18145-1-find.dhiraj@gmail.com>
Date: Thu, 10 Jun 2021 16:29:17 +0100
From: Dhiraj Shah <find.dhiraj@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: find.dhiraj@...il.com, "K. Y. Srinivasan" <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Shachar Raindel <shacharr@...rosoft.com>,
Colin Ian King <colin.king@...onical.com>,
linux-hyperv@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] function mana_hwc_create_wq leaks memory
memory space allocated for the queue in function
mana_gd_create_hwc_queue is not freed during error condition.
Signed-off-by: Dhiraj Shah <find.dhiraj@...il.com>
---
drivers/net/ethernet/microsoft/mana/hw_channel.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/microsoft/mana/hw_channel.c b/drivers/net/ethernet/microsoft/mana/hw_channel.c
index 1a923fd99990..4aa4bda518fb 100644
--- a/drivers/net/ethernet/microsoft/mana/hw_channel.c
+++ b/drivers/net/ethernet/microsoft/mana/hw_channel.c
@@ -501,8 +501,10 @@ static int mana_hwc_create_wq(struct hw_channel_context *hwc,
*hwc_wq_ptr = hwc_wq;
return 0;
out:
- if (err)
+ if (err) {
+ kfree(queue);
mana_hwc_destroy_wq(hwc, hwc_wq);
+ }
return err;
}
--
2.30.1 (Apple Git-130)
Powered by blists - more mailing lists