提交 da7d998b 编写于 作者: A Amit Shah

char: Detect chardev release by NULL handlers as well as NULL opaque

Juan says he prefers these extra checks to ensure a user of a chardev is
releasing it.
Requested-by: NJuan Quintela <quintela@redhat.com>
Signed-off-by: NAmit Shah <amit.shah@redhat.com>
上级 d5b27167
......@@ -197,7 +197,7 @@ void qemu_chr_add_handlers(CharDriverState *s,
IOEventHandler *fd_event,
void *opaque)
{
if (!opaque) {
if (!opaque && !fd_can_read && !fd_read && !fd_event) {
/* chr driver being released. */
++s->avail_connections;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册