]> git.ipfire.org Git - thirdparty/qemu.git/commit
chardev/char.c: Always pass id to chardev_new
authorLukas Straub <lukasstraub2@web.de>
Tue, 30 Mar 2021 18:13:28 +0000 (20:13 +0200)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 1 Apr 2021 11:27:44 +0000 (15:27 +0400)
commitf36b0efd7f1a4b0383e1e36bc1c450ba4d8b7c6c
tree14a011d9f8a5bfcd53448f1cd51c16f52e57c12a
parent789fd6934e1511d7e487c6277ab762189ddd05b3
chardev/char.c: Always pass id to chardev_new

Always pass the id to chardev_new, since it is needed to register
the yank instance for the chardev. Also, after checking that
nothing calls chardev_new with id=NULL, assert() that id!=NULL.

This fixes a crash when using chardev-change to change a chardev
to chardev-socket, which attempts to register a yank instance.
This in turn tries to dereference the NULL-pointer.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Li Zhang <li.zhang@cloud.ionos.com>
Message-Id: <3e669b6c160aa7278e37c4d95e0445574f96c7b7.1617127849.git.lukasstraub2@web.de>
chardev/char.c