Skip to content

Commit

Permalink
Drivers: hv: vmbus: Release cpu lock in error case
Browse files Browse the repository at this point in the history
In case of invalid sub channel, release cpu lock before returning.

Fixes: a949e86 ("Drivers: hv: vmbus: Resolve race between init_vp_index() and CPU hotplug")
Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/1654794996-13244-1-git-send-email-ssengar@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
  • Loading branch information
Saurabh Sengar authored and Wei Liu committed Jun 10, 2022
1 parent f5f93d7 commit 656c5ba
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/hv/channel_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
*/
if (newchannel->offermsg.offer.sub_channel_index == 0) {
mutex_unlock(&vmbus_connection.channel_mutex);
cpus_read_unlock();
/*
* Don't call free_channel(), because newchannel->kobj
* is not initialized yet.
Expand Down

0 comments on commit 656c5ba

Please sign in to comment.