Skip to content

Commit

Permalink
usb: mtp: avoid empty description string
Browse files Browse the repository at this point in the history
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
kraxel committed May 5, 2014
1 parent 2dc7fdf commit 457d397
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/usb/dev-mtp.c
Expand Up @@ -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");
Expand Down

0 comments on commit 457d397

Please sign in to comment.