mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: unisys: unneeded NULL check
@ 2014-11-07 12:18 Sudip Mukherjee
  2014-11-07 12:18 ` [PATCH 2/2] staging: unisys: dereferencing NULL pointer Sudip Mukherjee
  0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2014-11-07 12:18 UTC (permalink / raw)
  To: Benjamin Romer, David Kershner, Greg Kroah-Hartman
  Cc: Sudip Mukherjee, sparmaintainer, devel, linux-kernel

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 <sudip@vectorindia.org>
---
 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 65bc07b..aad19e4 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;
 Away:
 	if (rc == NULL) {
-		if (memregion != NULL) {
-			visor_memregion_destroy(memregion);
-			memregion = NULL;
-		}
+		visor_memregion_destroy(memregion);
+		memregion = NULL;
 	}
 	return rc;
 }
-- 
1.8.1.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-07 12:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-07 12:18 [PATCH 1/2] staging: unisys: unneeded NULL check Sudip Mukherjee
2014-11-07 12:18 ` [PATCH 2/2] staging: unisys: dereferencing NULL pointer Sudip Mukherjee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®