summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-05-31 14:00:27 +0200
committerMichael Tokarev <mjt@tls.msk.ru>2013-06-01 14:25:39 +0400
commita4cc73d629d43c8a4d171d043ff229a959df3ca6 (patch)
treee4217378c556489b6f2f6e9b747978d931e7527b /monitor.c
parentcd2e64ce306910f6a627d899e6779eda33f8511c (diff)
downloadqemu-a4cc73d629d43c8a4d171d043ff229a959df3ca6.tar.gz
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 <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c2
1 files changed, 1 insertions, 1 deletions
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 */