Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 604a1eb0 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman
Browse files

Staging: hv: vmbus: Don't free the channel when the channel is closed



When the driver unloads, the device must persist. A channel represents the
device and so we should not free the channel when the channel is closed as
part of the driver unloading.

Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarAbhishek Kane <v-abkane@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2aa05dcb
Loading
Loading
Loading
Loading
+0 −14
Original line number Original line Diff line number Diff line
@@ -552,7 +552,6 @@ void vmbus_close(struct vmbus_channel *channel)
{
{
	struct vmbus_channel_close_channel *msg;
	struct vmbus_channel_close_channel *msg;
	struct vmbus_channel_msginfo *info;
	struct vmbus_channel_msginfo *info;
	unsigned long flags;
	int ret;
	int ret;


	/* Stop callback and cancel the timer asap */
	/* Stop callback and cancel the timer asap */
@@ -591,19 +590,6 @@ void vmbus_close(struct vmbus_channel *channel)


	kfree(info);
	kfree(info);


	/*
	 * If we are closing the channel during an error path in
	 * opening the channel, don't free the channel since the
	 * caller will free the channel
	 */

	if (channel->state == CHANNEL_OPEN_STATE) {
		spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
		list_del(&channel->listentry);
		spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);

		free_channel(channel);
	}
}
}
EXPORT_SYMBOL_GPL(vmbus_close);
EXPORT_SYMBOL_GPL(vmbus_close);