linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] tty: vt: Remove redundant null check before kfree.
@ 2012-11-21  5:19 Sachin Kamat
  2012-11-21 14:46 ` Greg KH
  0 siblings, 1 reply; 11+ messages in thread
From: Sachin Kamat @ 2012-11-21  5:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, sachin.kamat, patches

kfree on a NULL pointer is a no-op.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/tty/vt/consolemap.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c
index 2aaa0c2..248381b 100644
--- a/drivers/tty/vt/consolemap.c
+++ b/drivers/tty/vt/consolemap.c
@@ -410,10 +410,8 @@ static void con_release_unimap(struct uni_pagedir *p)
 		kfree(p->inverse_translations[i]);
 		p->inverse_translations[i] = NULL;
 	}
-	if (p->inverse_trans_unicode) {
-		kfree(p->inverse_trans_unicode);
-		p->inverse_trans_unicode = NULL;
-	}
+	kfree(p->inverse_trans_unicode);
+	p->inverse_trans_unicode = NULL;
 }
 
 /* Caller must hold the console lock */
-- 
1.7.4.1


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

end of thread, other threads:[~2012-11-22 21:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-21  5:19 [PATCH 1/1] tty: vt: Remove redundant null check before kfree Sachin Kamat
2012-11-21 14:46 ` Greg KH
2012-11-21 14:51   ` Sachin Kamat
2012-11-21 15:16     ` Greg KH
2012-11-21 15:29       ` Sachin Kamat
2012-11-21 16:54         ` Greg KH
2012-11-21 22:43   ` Jiri Slaby
2012-11-21 23:00     ` Greg KH
2012-11-21 23:17       ` Jiri Slaby
2012-11-22  0:38         ` Greg KH
2012-11-22  5:19           ` Sachin Kamat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).