[ovs-dev,2/4,v2] datapath-windows: reset the IRP pointer after use in OvsQueuePackets
diff mbox

Message ID 1443024933-47622-2-git-send-email-nithin@vmware.com
State Accepted
Headers show

Commit Message

Nithin Raju Sept. 23, 2015, 4:15 p.m. UTC
Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
---
v2: collected acks
---
 datapath-windows/ovsext/User.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

Comments

Ben Pfaff Sept. 30, 2015, 5:43 a.m. UTC | #1
On Wed, Sep 23, 2015 at 09:15:31AM -0700, Nithin Raju wrote:
> Signed-off-by: Nithin Raju <nithin@vmware.com>
> Acked-by: Sairam Venugopal <vsairam@vmware.com>
> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
> ---
> v2: collected acks

Applied, thanks!

Patch
diff mbox

diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c
index 0bbf690..d6139b8 100644
--- a/datapath-windows/ovsext/User.c
+++ b/datapath-windows/ovsext/User.c
@@ -698,7 +698,6 @@  OvsQueuePackets(PLIST_ENTRY packetList,
 {
     POVS_USER_PACKET_QUEUE upcallQueue = NULL;
     POVS_PACKET_QUEUE_ELEM elem;
-    PIRP irp = NULL;
     PLIST_ENTRY  link;
     UINT32 num = 0;
     LIST_ENTRY dropPackets;
@@ -728,23 +727,17 @@  OvsQueuePackets(PLIST_ENTRY packetList,
                 InsertTailList(&upcallQueue->packetList, &elem->link);
                 upcallQueue->numPackets++;
                 if (upcallQueue->pendingIrp) {
+                    PIRP irp = upcallQueue->pendingIrp;
                     PDRIVER_CANCEL cancelRoutine;
-                    irp = upcallQueue->pendingIrp;
                     upcallQueue->pendingIrp = NULL;
                     cancelRoutine = IoSetCancelRoutine(irp, NULL);
-                    if (cancelRoutine == NULL) {
-                        irp = NULL;
+                    if (cancelRoutine != NULL) {
+                        OvsCompleteIrpRequest(irp, 0, STATUS_SUCCESS);
                     }
                 }
             }
-
-            if (irp) {
-                OvsCompleteIrpRequest(irp, 0, STATUS_SUCCESS);
-            }
-
             NdisReleaseSpinLock(&upcallQueue->queueLock);
         }
-
         OvsReleasePidHashLock();
     }