summaryrefslogtreecommitdiffstats
path: root/drivers/hv/connection.c
diff options
context:
space:
mode:
authorDexuan Cui <decui@microsoft.com>2016-01-27 22:29:43 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-07 21:34:12 -0800
commit85d9aa705184a4504d0330017e3956fcdae8a9d6 (patch)
tree7c774df32a8aa8bce2eb3be6d06ddd8e0add4171 /drivers/hv/connection.c
parent499e8401a515d04daa986b995da710d2b9737764 (diff)
downloadlinux-85d9aa705184a4504d0330017e3956fcdae8a9d6.tar.gz
linux-85d9aa705184a4504d0330017e3956fcdae8a9d6.tar.bz2
linux-85d9aa705184a4504d0330017e3956fcdae8a9d6.zip
Drivers: hv: vmbus: add an API vmbus_hvsock_device_unregister()
The hvsock driver needs this API to release all the resources related to the channel. Signed-off-by: Dexuan Cui <decui@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv/connection.c')
-rw-r--r--drivers/hv/connection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index 4a320e60641a..fa86b2cb28b8 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -288,7 +288,8 @@ struct vmbus_channel *relid2channel(u32 relid)
struct list_head *cur, *tmp;
struct vmbus_channel *cur_sc;
- mutex_lock(&vmbus_connection.channel_mutex);
+ BUG_ON(!mutex_is_locked(&vmbus_connection.channel_mutex));
+
list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
if (channel->offermsg.child_relid == relid) {
found_channel = channel;
@@ -307,7 +308,6 @@ struct vmbus_channel *relid2channel(u32 relid)
}
}
}
- mutex_unlock(&vmbus_connection.channel_mutex);
return found_channel;
}