From f9b64692e13b2f0d2a393e41972aa317f34a3e46 Mon Sep 17 00:00:00 2001 From: Sudip Mukherjee Date: Fri, 7 Nov 2014 17:48:34 +0530 Subject: [PATCH] staging: unisys: unneeded NULL check the NULL check for memregion is not required as it has already been checked for NULL after kzalloc. so we can reach this part of the code only if memregion is not NULL. Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman --- drivers/staging/unisys/visorutil/memregion_direct.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/unisys/visorutil/memregion_direct.c b/drivers/staging/unisys/visorutil/memregion_direct.c index 26faad470705..33522cc8c22c 100644 --- a/drivers/staging/unisys/visorutil/memregion_direct.c +++ b/drivers/staging/unisys/visorutil/memregion_direct.c @@ -57,10 +57,8 @@ visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes) rc = memregion; cleanup: if (rc == NULL) { - if (memregion != NULL) { - visor_memregion_destroy(memregion); - memregion = NULL; - } + visor_memregion_destroy(memregion); + memregion = NULL; } return rc; } -- 2.39.5