From: Bill Pemberton Date: Wed, 5 May 2010 19:27:29 +0000 (-0400) Subject: Staging: hv: Remove check for NULL before calling kfree() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1e19c054434c7d3ad618129c2ff5c3d81efa6949;p=linux-beck.git 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 --- 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;