Browse Source

Staging: hv: Remove check for NULL before calling kfree()

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>
Bill Pemberton 15 years ago
parent
commit
1e19c05443
1 changed files with 3 additions and 5 deletions
  1. 3 5
      drivers/staging/hv/Hv.c

+ 3 - 5
drivers/staging/hv/Hv.c

@@ -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;