From: Bill Pemberton <[email protected]>

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 <[email protected]>
Cc: Hank Janssen <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/staging/hv/Hv.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/hv/Hv.c b/drivers/staging/hv/Hv.c
index bfcb750..2418651 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;
-- 
1.7.0.3

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to