[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Dont mix Exclusive and Shared locking calls


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: <owen.smith@xxxxxxxxxx>
  • Date: Tue, 4 Aug 2020 15:49:21 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Owen Smith <owen.smith@xxxxxxxxxx>
  • Delivery-date: Tue, 04 Aug 2020 14:50:07 +0000
  • Ironport-sdr: eA0hVYXrzJTjs02QGdE8cIZrSbKCtZheg1hlINpX0dgah16uyktmiUL7yogRRuccbTAMNblmTP XKT0gWOTKafdOXQBq8/f1XHCUHy5Hilm4pbRPi6RdDOjLKPdhCPNFw9Q5TCQrIVI3hKd/8rLgt TOdDcmA6eGTqtTt9KWTTwsvx/pO5yeVO312HQpd0jS2cLLIICzyePQMHZ67N2EcTuF6orm6Sqi d4QYZDffqXnbkuvFHT9qDcYNo7k3OrJuO1NuDzvIIIZeCDWL7CubNLhnXNbYCNsS4rhX7B2WOC ZTE=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

From: Owen Smith <owen.smith@xxxxxxxxxx>

If the lock is acquired with ExAcquireSpinLockSharedAtDpcLevel(), it
should always be released with ExReleaseSpinLockSharedFromDpcLevel()
(unless the lock is converted to an exclusive lock)

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/xenvif/mac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/xenvif/mac.c b/src/xenvif/mac.c
index 3301ef9..a89904b 100644
--- a/src/xenvif/mac.c
+++ b/src/xenvif/mac.c
@@ -394,7 +394,7 @@ fail2:
 fail1:
     Error("fail1 (%08x)\n", status);
 
-    __MacReleaseLockExclusive(Mac);
+    __MacReleaseLockShared(Mac);
     KeLowerIrql(Irql);
 
     return status;
@@ -974,7 +974,7 @@ MacQueryMulticastAddresses(
 fail1:
     *Count = Mac->MulticastCount;
 
-    __MacReleaseLockExclusive(Mac);
+    __MacReleaseLockShared(Mac);
     KeLowerIrql(Irql);
 
     return status;
-- 
2.16.2.windows.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.