]> Pileus Git - ~andy/linux/blobdiff - drivers/hv/channel_mgmt.c
Merge branch 'for-next' of git://git.infradead.org/users/dhowells/linux-headers
[~andy/linux] / drivers / hv / channel_mgmt.c
index 12b85ff957fd2d56b2ef42bf829cc1f74e7a26d6..36484db36baf01709846cd4224589a8863e9ab72 100644 (file)
@@ -223,6 +223,17 @@ static void vmbus_process_rescind_offer(struct work_struct *work)
        vmbus_device_unregister(channel->device_obj);
 }
 
+void vmbus_free_channels(void)
+{
+       struct vmbus_channel *channel;
+
+       list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
+               vmbus_device_unregister(channel->device_obj);
+               kfree(channel->device_obj);
+               free_channel(channel);
+       }
+}
+
 /*
  * vmbus_process_offer - Process the offer by creating a channel/device
  * associated with this offer
@@ -287,6 +298,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 {