diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-03-11 14:27:13 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-03-11 14:27:13 +0000 |
commit | 9159eb9abc31e02797dc55998e71f12c06846d55 (patch) | |
tree | b4a101344514301b418718c6b214d089f0b12876 | |
parent | 8d86e34e65d6d4c8201de6356635f34d38391a93 (diff) | |
parent | b18a755c4266a340a25ab4118525bd57c3dfc3fa (diff) |
Merge remote-tracking branch 'remotes/amit/tags/vser-for-2.3-1' into staging
virtio-serial: fix crash on port hotplug when a previously-added port
did not have the 'name' property set.
# gpg: Signature made Wed Mar 11 11:13:53 2015 GMT using RSA key ID 854083B6
# gpg: Good signature from "Amit Shah <amit@amitshah.net>"
# gpg: aka "Amit Shah <amit@kernel.org>"
# gpg: aka "Amit Shah <amitshah@gmx.net>"
* remotes/amit/tags/vser-for-2.3-1:
virtio-serial: fix segfault on NULL port names
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | hw/char/virtio-serial-bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index 9a029d2130..c86814f059 100644 --- a/hw/char/virtio-serial-bus.c +++ b/hw/char/virtio-serial-bus.c @@ -64,7 +64,7 @@ static VirtIOSerialPort *find_port_by_name(char *name) VirtIOSerialPort *port; QTAILQ_FOREACH(port, &vser->ports, next) { - if (!strcmp(port->name, name)) { + if (port->name && !strcmp(port->name, name)) { return port; } } |