/* VmbusChannelReleaseUnattachedChannels - Release channels that are unattached/unconnected ie (no drivers associated)  */
void VmbusChannelReleaseUnattachedChannels(void)
/* VmbusChannelReleaseUnattachedChannels - Release channels that are unattached/unconnected ie (no drivers associated)  */
void VmbusChannelReleaseUnattachedChannels(void)
{
	struct vmbus_channel *channel, *pos;
	struct vmbus_channel *start = NULL;
	unsigned long flags;
	spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
	list_for_each_entry_safe(channel, pos, &gVmbusConnection.ChannelList,
				 ListEntry) {
		if (channel == start)
			break;
		if (!channel->DeviceObject->Driver) {
			list_del(&channel->ListEntry);
			DPRINT_INFO(VMBUS,
				    "Releasing unattached device object %p",
				    channel->DeviceObject);
			VmbusChildDeviceRemove(channel->DeviceObject);
			FreeVmbusChannel(channel);
		} else {
			if (!start)
				start = channel;
		}
	}
	spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags);
}