Skip to content

Commit

Permalink
Staging: hv: vmbus: Don't free the channel when the channel is closed
Browse files Browse the repository at this point in the history
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: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Jun 7, 2011
1 parent 2aa05dc commit 604a1eb
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions drivers/staging/hv/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@ void vmbus_close(struct vmbus_channel *channel)
{
struct vmbus_channel_close_channel *msg;
struct vmbus_channel_msginfo *info;
unsigned long flags;
int ret;

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

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);

Expand Down

0 comments on commit 604a1eb

Please sign in to comment.