qemu/backends
Lin Ma 9e14037f05 msmouse: Fix segfault caused by free the chr before chardev cleanup.
Segfault happens when leaving qemu with msmouse backend:

 #0  0x00007fa8526ac975 in raise () at /lib64/libc.so.6
 #1  0x00007fa8526add8a in abort () at /lib64/libc.so.6
 #2  0x0000558be78846ab in error_exit (err=16, msg=0x558be799da10 ...
 #3  0x0000558be7884717 in qemu_mutex_destroy (mutex=0x558be93be750) at ...
 #4  0x0000558be7549951 in qemu_chr_free_common (chr=0x558be93be750) at ...
 #5  0x0000558be754999c in qemu_chr_free (chr=0x558be93be750) at ...
 #6  0x0000558be7549a20 in qemu_chr_delete (chr=0x558be93be750) at ...
 #7  0x0000558be754a8ef in qemu_chr_cleanup () at qemu-char.c:4643
 #8  0x0000558be755843e in main (argc=5, argv=0x7ffe925d7118, ...

The chr was freed by msmouse close callback before chardev cleanup,
Then qemu_mutex_destroy triggered raise().

Because freeing chr is handled by qemu_chr_free_common, Remove the free from
msmouse_chr_close to avoid double free.

Fixes: c1111a24a3
Cc: qemu-stable@nongnu.org
Signed-off-by: Lin Ma <lma@suse.com>
Message-Id: <20160915143158.4796-1-lma@suse.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-09-22 20:20:53 +02:00
..
baum.c Replaced get_tick_per_sec() by NANOSECONDS_PER_SECOND 2016-03-22 22:20:17 +01:00
hostmem-file.c hostmem-file: plug a small leak 2016-04-15 17:56:06 +02:00
hostmem-ram.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
hostmem.c fix qemu exit on memory hotplug when allocation fails at prealloc time 2016-08-02 12:03:58 +02:00
Makefile.objs backends: Introduce chr-testdev 2014-08-06 17:53:05 +02:00
msmouse.c msmouse: Fix segfault caused by free the chr before chardev cleanup. 2016-09-22 20:20:53 +02:00
rng-egd.c hw: replace most use of qemu_chr_fe_write with qemu_chr_fe_write_all 2016-09-13 19:09:42 +02:00
rng-random.c rng-random: rename RndRandom to RngRandom 2016-05-23 12:18:43 +05:30
rng.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
testdev.c backends: Clean up includes 2016-02-04 17:01:04 +00:00
tpm.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00