Drivers: hv: vmbus: Release cpu lock in error case
Subsystems (2)
PATCH 1/1 Drivers: hv: vmbus: Release cpu lock in error case
In case of invalid sub channel, release cpu lock before returning.
Signed-off-by Saurabh Sengar <[email protected]>
--- drivers/hv/channel_mgmt.c | 1 + 1 file changed, 1 insertion(+)
drivers/hv/channel_mgmt.c +1 -0
@@ -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.
Signature · 1 line
1.8.3.1
From: Saurabh Sengar <[email protected]> Sent: Thursday, June 9, 2022 10:17 AM
Quoted 20 lines
In case of invalid sub channel, release cpu lock before returning.
Signed-off-by Saurabh Sengar <[email protected]>--- drivers/hv/channel_mgmt.c | 1 + 1 file changed, 1 insertion(+)drivers/hv/channel_mgmt.c +1
-0@@ -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
Quoted 3 lines
* is not initialized yet.
--
1.8.3.1
Reviewed-by Michael Kelley <[email protected]>
Wei Liu
maintainerQuoted 18 lines · Michael Kelley (LINUX)
From: Saurabh Sengar <[email protected]> Sent: Thursday, June 9, 2022 10:17 AM
Quoted 17 lines
In case of invalid sub channel, release cpu lock before returning.
Signed-off-by Saurabh Sengar <[email protected]>--- drivers/hv/channel_mgmt.c | 1 + 1 file changed, 1 insertion(+)drivers/hv/channel_mgmt.c +0
-0@@ -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);
Quoted 9 lines
Quoted 6 lines
drivers/hv/channel_mgmt.c +1
-0+cpus_read_unlock ();/* * Don't call free_channel(), because newchannel->kobj * is not initialized yet.
--
1.8.3.1Reviewed-by Michael Kelley <[email protected]>
The bug comes from a949e86c0d780.
Added a Fixes tag and applied to hyperv-fixes. Thanks.