diff options
Diffstat (limited to 'drivers/hv/connection.c')
-rw-r--r-- | drivers/hv/connection.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c index 253a74ba245c..ec3b8cdf1e04 100644 --- a/drivers/hv/connection.c +++ b/drivers/hv/connection.c | |||
@@ -246,12 +246,26 @@ struct vmbus_channel *relid2channel(u32 relid) | |||
246 | struct vmbus_channel *channel; | 246 | struct vmbus_channel *channel; |
247 | struct vmbus_channel *found_channel = NULL; | 247 | struct vmbus_channel *found_channel = NULL; |
248 | unsigned long flags; | 248 | unsigned long flags; |
249 | struct list_head *cur, *tmp; | ||
250 | struct vmbus_channel *cur_sc; | ||
249 | 251 | ||
250 | spin_lock_irqsave(&vmbus_connection.channel_lock, flags); | 252 | spin_lock_irqsave(&vmbus_connection.channel_lock, flags); |
251 | list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) { | 253 | list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) { |
252 | if (channel->offermsg.child_relid == relid) { | 254 | if (channel->offermsg.child_relid == relid) { |
253 | found_channel = channel; | 255 | found_channel = channel; |
254 | break; | 256 | break; |
257 | } else if (!list_empty(&channel->sc_list)) { | ||
258 | /* | ||
259 | * Deal with sub-channels. | ||
260 | */ | ||
261 | list_for_each_safe(cur, tmp, &channel->sc_list) { | ||
262 | cur_sc = list_entry(cur, struct vmbus_channel, | ||
263 | sc_list); | ||
264 | if (cur_sc->offermsg.child_relid == relid) { | ||
265 | found_channel = cur_sc; | ||
266 | break; | ||
267 | } | ||
268 | } | ||
255 | } | 269 | } |
256 | } | 270 | } |
257 | spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags); | 271 | spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags); |