From a4cc73d629d43c8a4d171d043ff229a959df3ca6 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 31 May 2013 14:00:27 +0200 Subject: do not check pointers after dereferencing them Two instances, both spotted by Coverity. In one, two blocks were swapped. In the other, the check is not needed anymore. Cc: qemu-stable@nongnu.org Cc: qemu-trivial@nongnu.org Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'monitor.c') diff --git a/monitor.c b/monitor.c index 6ce2a4e61b..eefc7f083f 100644 --- a/monitor.c +++ b/monitor.c @@ -280,7 +280,7 @@ void monitor_flush(Monitor *mon) buf = qstring_get_str(mon->outbuf); len = qstring_get_length(mon->outbuf); - if (mon && len && !mon->mux_out) { + if (len && !mon->mux_out) { rc = qemu_chr_fe_write(mon->chr, (const uint8_t *) buf, len); if (rc == len) { /* all flushed */ -- cgit v1.2.1