X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=drivers%2Fhv%2Fchannel_mgmt.c;h=36484db36baf01709846cd4224589a8863e9ab72;hb=dca88ad6915b65f6e037f8c3e632fcd92a70bd88;hp=12b85ff957fd2d56b2ef42bf829cc1f74e7a26d6;hpb=da733563be5a9da26fe81d9f007262d00b846e22;p=~andy%2Flinux 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) 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 {