From: K. Y. Srinivasan <kys@microsoft.com>
Date: Mon, 12 Dec 2011 17:29:16 +0000 (-0800)
Subject: Drivers: hv: Fix a memory leak
X-Git-Tag: firefly_0821_release~3680^2~3471^2~11^2~12
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8b8ee6753154dd6cfe397e0d29fe7f90a8adb50b;p=firefly-linux-kernel-4.4.55.git

Drivers: hv: Fix a memory leak

There was a memory leak in a failure path in vmbus_process_offer().
Fix it.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 12b85ff957fd..b91af50875e9 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -287,6 +287,7 @@ static void vmbus_process_offer(struct work_struct *work)
 		spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
 		list_del(&newchannel->listentry);
 		spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
+		kfree(newchannel->device_obj);
 
 		free_channel(newchannel);
 	} else {