From 1e19c054434c7d3ad618129c2ff5c3d81efa6949 Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Wed, 5 May 2010 15:27:29 -0400 Subject: [PATCH] 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 Cc: Hank Janssen Cc: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman --- drivers/staging/hv/Hv.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/staging/hv/Hv.c b/drivers/staging/hv/Hv.c index bfcb75008bf5..2418651772b8 100644 --- a/drivers/staging/hv/Hv.c +++ b/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; -- 2.20.1