datapath-windows: reset the IRP pointer after use in OvsQueuePackets
authorNithin Raju <nithin@vmware.com>
Wed, 23 Sep 2015 16:15:31 +0000 (09:15 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 30 Sep 2015 05:43:18 +0000 (22:43 -0700)
Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows/ovsext/User.c

index 81a1a20..e7be904 100644 (file)
@@ -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();
     }