]> git.proxmox.com Git - mirror_qemu.git/commitdiff
usb-mtp: print parent path in IN_IGNORED trace fn
authorBandan Das <bsd@redhat.com>
Fri, 23 Feb 2018 16:48:26 +0000 (11:48 -0500)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 26 Feb 2018 11:18:36 +0000 (12:18 +0100)
Fix a possible null dereference when deleting a folder and
its contents. An ignored event might be received for its contents
after the parent folder is deleted which will return a null object.

Signed-off-by: Bandan Das <bsd@redhat.com>
Message-id: 20180223164829.29683-3-bsd@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/dev-mtp.c

index b55aa8205e798e988bccd23393232474fe43d232..63f8f3b90b5bf3527e7c40c9136f73006b50cb2d 100644 (file)
@@ -540,9 +540,8 @@ static void inotify_watchfn(void *arg)
                 break;
 
             case IN_IGNORED:
-                o = usb_mtp_object_lookup_name(parent, event->name, event->len);
-                trace_usb_mtp_inotify_event(s->dev.addr, o->path,
-                                      event->mask, "Obj ignored");
+                trace_usb_mtp_inotify_event(s->dev.addr, parent->path,
+                                      event->mask, "Obj parent dir ignored");
                 break;
 
             default: