]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
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>
Wed, 12 May 2010 22:02:41 +0000 (15:02 -0700)
commit fa8ad0257ea256381126ecf447694622216c600f upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/Hv.c

index c2809f2a2ce0e0e72b1b930f39929a50179d3cd5..b12237f90db24e1e63a2013af0b57a1d130b7b96 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.GuestId == HV_LINUX_GUEST_ID) {