diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2013-10-11 20:27:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-16 16:55:46 -0400 |
commit | 90d33f3ec519db19d785216299a4ee85ef58ec97 (patch) | |
tree | 6b98ac7965d24f96d9dc7da20f64c4c2f467a34a | |
parent | bc04d76d6942068f75c10790072280b847ec6f1f (diff) |
Drivers: hv: vmbus: Fix a bug in channel rescind code
Rescind of subchannels were not being correctly handled. Fix the bug.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: <stable@vger.kernel.org> [3.11+]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/hv/channel_mgmt.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index bbff5f200bef..eebf56634ed5 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c | |||
@@ -203,7 +203,8 @@ static void vmbus_process_rescind_offer(struct work_struct *work) | |||
203 | struct vmbus_channel *primary_channel; | 203 | struct vmbus_channel *primary_channel; |
204 | struct vmbus_channel_relid_released msg; | 204 | struct vmbus_channel_relid_released msg; |
205 | 205 | ||
206 | vmbus_device_unregister(channel->device_obj); | 206 | if (channel->device_obj) |
207 | vmbus_device_unregister(channel->device_obj); | ||
207 | memset(&msg, 0, sizeof(struct vmbus_channel_relid_released)); | 208 | memset(&msg, 0, sizeof(struct vmbus_channel_relid_released)); |
208 | msg.child_relid = channel->offermsg.child_relid; | 209 | msg.child_relid = channel->offermsg.child_relid; |
209 | msg.header.msgtype = CHANNELMSG_RELID_RELEASED; | 210 | msg.header.msgtype = CHANNELMSG_RELID_RELEASED; |
@@ -213,11 +214,6 @@ static void vmbus_process_rescind_offer(struct work_struct *work) | |||
213 | spin_lock_irqsave(&vmbus_connection.channel_lock, flags); | 214 | spin_lock_irqsave(&vmbus_connection.channel_lock, flags); |
214 | list_del(&channel->listentry); | 215 | list_del(&channel->listentry); |
215 | spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags); | 216 | spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags); |
216 | } else { | ||
217 | primary_channel = channel->primary_channel; | ||
218 | spin_lock_irqsave(&primary_channel->sc_lock, flags); | ||
219 | list_del(&channel->listentry); | ||
220 | spin_unlock_irqrestore(&primary_channel->sc_lock, flags); | ||
221 | } | 217 | } |
222 | free_channel(channel); | 218 | free_channel(channel); |
223 | } | 219 | } |