aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hv/channel_mgmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hv/channel_mgmt.c')
-rw-r--r--drivers/hv/channel_mgmt.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 12b85ff957f..36484db36ba 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -223,6 +223,17 @@ static void vmbus_process_rescind_offer(struct work_struct *work)
223 vmbus_device_unregister(channel->device_obj); 223 vmbus_device_unregister(channel->device_obj);
224} 224}
225 225
226void vmbus_free_channels(void)
227{
228 struct vmbus_channel *channel;
229
230 list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
231 vmbus_device_unregister(channel->device_obj);
232 kfree(channel->device_obj);
233 free_channel(channel);
234 }
235}
236
226/* 237/*
227 * vmbus_process_offer - Process the offer by creating a channel/device 238 * vmbus_process_offer - Process the offer by creating a channel/device
228 * associated with this offer 239 * associated with this offer
@@ -287,6 +298,7 @@ static void vmbus_process_offer(struct work_struct *work)
287 spin_lock_irqsave(&vmbus_connection.channel_lock, flags); 298 spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
288 list_del(&newchannel->listentry); 299 list_del(&newchannel->listentry);
289 spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags); 300 spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
301 kfree(newchannel->device_obj);
290 302
291 free_channel(newchannel); 303 free_channel(newchannel);
292 } else { 304 } else {