Staging: hv: Remove check for NULL before calling kfree()
authorBill Pemberton <wfp5p@virginia.edu>
Wed, 5 May 2010 19:27:29 +0000 (15:27 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 11 May 2010 18:36:12 +0000 (11:36 -0700)
kfree() knows how to deal with NULL, so there's no reason to check for
NULL before passing something to it.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
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 bfcb750..2418651 100644 (file)
@@ -305,11 +305,9 @@ void HvCleanup(void)
 
        DPRINT_ENTER(VMBUS);
 
-       if (gHvContext.SignalEventBuffer) {
-               gHvContext.SignalEventBuffer = NULL;
-               gHvContext.SignalEventParam = NULL;
-               kfree(gHvContext.SignalEventBuffer);
-       }
+       kfree(gHvContext.SignalEventBuffer);
+       gHvContext.SignalEventBuffer = NULL;
+       gHvContext.SignalEventParam = NULL;
 
        if (gHvContext.HypercallPage) {
                hypercallMsr.AsUINT64 = 0;