提交 dc168eb4 编写于 作者: S Saurabh Sengar 提交者: Zheng Zengkai

Drivers: hv: vmbus: Release cpu lock in error case

stable inclusion
from stable-v5.10.124
commit 5334455067d51ea043d302a1d052db9b8af4832e
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6E7

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5334455067d51ea043d302a1d052db9b8af4832e

--------------------------------

[ Upstream commit 656c5ba5 ]

In case of invalid sub channel, release cpu lock before returning.

Fixes: a949e86c ("Drivers: hv: vmbus: Resolve race between init_vp_index() and CPU hotplug")
Signed-off-by: NSaurabh Sengar <ssengar@linux.microsoft.com>
Reviewed-by: NMichael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/1654794996-13244-1-git-send-email-ssengar@linux.microsoft.comSigned-off-by: NWei Liu <wei.liu@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 f5757eb4
...@@ -606,6 +606,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) ...@@ -606,6 +606,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
*/ */
if (newchannel->offermsg.offer.sub_channel_index == 0) { if (newchannel->offermsg.offer.sub_channel_index == 0) {
mutex_unlock(&vmbus_connection.channel_mutex); mutex_unlock(&vmbus_connection.channel_mutex);
cpus_read_unlock();
/* /*
* Don't call free_channel(), because newchannel->kobj * Don't call free_channel(), because newchannel->kobj
* is not initialized yet. * is not initialized yet.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册