From 012aef073461fd24a901d7a8742532093b7f6ae5 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 26 Aug 2015 14:02:53 +0200 Subject: maint: avoid useless "if (foo) free(foo)" pattern My Coccinelle semantic patch finds a few more, because it also fixes up the equally pointless conditional if (foo) { free(foo); foo = NULL; } Result (feel free to squash it into your patch): Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- translate-all.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'translate-all.c') diff --git a/translate-all.c b/translate-all.c index 2a40530..8eb4512 100644 --- a/translate-all.c +++ b/translate-all.c @@ -731,10 +731,8 @@ void tb_free(TranslationBlock *tb) static inline void invalidate_page_bitmap(PageDesc *p) { - if (p->code_bitmap) { - g_free(p->code_bitmap); - p->code_bitmap = NULL; - } + g_free(p->code_bitmap); + p->code_bitmap = NULL; p->code_write_count = 0; } -- cgit v1.1