summaryrefslogtreecommitdiffstats
path: root/drivers/hv
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2015-05-06 17:47:44 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-24 12:19:00 -0700
commit357e836a609812ab28fb56df28555295191bd330 (patch)
tree34d4ec7dfefb5e72d7a2d2ff4be391cde0863b34 /drivers/hv
parentfea844a2b0edd6540d5cde2cd54a8a3c86e9c53f (diff)
downloadtalos-obmc-linux-357e836a609812ab28fb56df28555295191bd330.tar.gz
talos-obmc-linux-357e836a609812ab28fb56df28555295191bd330.zip
Drivers: hv: vmbus: decrease num_sc on subchannel removal
It is unlikely that that host will ask us to close only one subchannel for a device but let's be consistent. Do both num_sc++ and num_sc-- with channel->lock to be on the safe side. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/channel_mgmt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index b28cbdfe8b54..c53a171f2dc4 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -205,6 +205,7 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid)
primary_channel = channel->primary_channel;
spin_lock_irqsave(&primary_channel->lock, flags);
list_del(&channel->sc_list);
+ primary_channel->num_sc--;
spin_unlock_irqrestore(&primary_channel->lock, flags);
}
free_channel(channel);
@@ -265,8 +266,8 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
newchannel->primary_channel = channel;
spin_lock_irqsave(&channel->lock, flags);
list_add_tail(&newchannel->sc_list, &channel->sc_list);
- spin_unlock_irqrestore(&channel->lock, flags);
channel->num_sc++;
+ spin_unlock_irqrestore(&channel->lock, flags);
} else
goto err_free_chan;
}
OpenPOWER on IntegriCloud