Staging: hv: Fix up memory leak on HvCleanup
authorCyrill Gorcunov <gorcunov@openvz.org>
Mon, 5 Apr 2010 16:56:57 +0000 (20:56 +0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 30 Apr 2010 16:30:09 +0000 (09:30 -0700)
Don't assign NULL too early

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/Hv.c

index 5d53889fb4a42196d88bfc590eaadd2339a21f63..3a1112d29aeb731962939b85bc70c571c83b1376 100644 (file)
@@ -306,9 +306,9 @@ void HvCleanup(void)
        DPRINT_ENTER(VMBUS);
 
        if (gHvContext.SignalEventBuffer) {
+               kfree(gHvContext.SignalEventBuffer);
                gHvContext.SignalEventBuffer = NULL;
                gHvContext.SignalEventParam = NULL;
-               kfree(gHvContext.SignalEventBuffer);
        }
 
        if (gHvContext.HypercallPage) {