Skip to content

Commit

Permalink
Staging: hv: Remove check for NULL before calling kfree()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bill Pemberton authored and Greg Kroah-Hartman committed May 11, 2010
1 parent 2342df0 commit 1e19c05
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/staging/hv/Hv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1e19c05

Please sign in to comment.