From: K. Y. Srinivasan Date: Mon, 6 Jun 2011 22:49:59 +0000 (-0700) Subject: Staging: hv: vmbus: Use the newly introduced state in closing the channel X-Git-Tag: MMI-PSA29.97-13-9~18845^2~568^2~47 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e9a27a9f9ef18826030f6d50efde0dc68b7d1be2;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git Staging: hv: vmbus: Use the newly introduced state in closing the channel Now, use the newly introduced state in closing the channel and eliminate a potential failure condition (that currently was not being handled correctly). Signed-off-by: K. Y. Srinivasan Signed-off-by: Haiyang Zhang Signed-off-by: Abhishek Kane Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c index 043fe25ed4f3..5a2a947debd8 100644 --- a/drivers/staging/hv/channel.c +++ b/drivers/staging/hv/channel.c @@ -549,22 +549,15 @@ EXPORT_SYMBOL_GPL(vmbus_teardown_gpadl); void vmbus_close(struct vmbus_channel *channel) { struct vmbus_channel_close_channel *msg; - struct vmbus_channel_msginfo *info; int ret; /* Stop callback and cancel the timer asap */ channel->onchannel_callback = NULL; /* Send a closing message */ - info = kmalloc(sizeof(*info) + - sizeof(struct vmbus_channel_close_channel), GFP_KERNEL); - /* FIXME: can't do anything other than return here because the - * function is void */ - if (!info) - return; + msg = &channel->close_msg.msg; - msg = (struct vmbus_channel_close_channel *)info->msg; msg->header.msgtype = CHANNELMSG_CLOSECHANNEL; msg->child_relid = channel->offermsg.child_relid; @@ -583,7 +576,6 @@ void vmbus_close(struct vmbus_channel *channel) free_pages((unsigned long)channel->ringbuffer_pages, get_order(channel->ringbuffer_pagecount * PAGE_SIZE)); - kfree(info); } EXPORT_SYMBOL_GPL(vmbus_close);