aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2014-04-25 12:06:47 +0200
committerGerd Hoffmann <kraxel@redhat.com>2014-05-05 12:57:49 +0200
commit457d397a2485225a96d6a9fc33cfe04f99e1e0f4 (patch)
tree14293f7c9b71734d020774c3c5206513259d1ff5 /hw
parent2dc7fdf33d28940255f171b8ea4b692d9d5b7a7d (diff)
usb: mtp: avoid empty description string
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb/dev-mtp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 45f9562c60..a30a88639c 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -1046,7 +1046,7 @@ static int usb_mtp_initfn(USBDevice *dev)
QTAILQ_INIT(&s->objects);
if (s->desc == NULL) {
s->desc = strrchr(s->root, '/');
- if (s->desc) {
+ if (s->desc && s->desc[0]) {
s->desc = g_strdup(s->desc + 1);
} else {
s->desc = g_strdup("none");