From 13f7ae9457855a2140e5cfbe7041c99c468ed43a Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Mon, 9 Feb 2015 09:33:36 -0600 Subject: Fix erroneous infinite loop in MTP inotify_t Change-Id: I60ce40bd08e2ce9b04beb5dc4876b86f3688861b --- mtp/MtpStorage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mtp/MtpStorage.cpp b/mtp/MtpStorage.cpp index 1f4d142f0..5a6954822 100755 --- a/mtp/MtpStorage.cpp +++ b/mtp/MtpStorage.cpp @@ -714,7 +714,7 @@ int MtpStorage::inotify_t(void) { MTPE("inotify_t Can't read inotify events\n"); } - while (inotify_thread_kill.get_value() == 0) { + while (i < len && inotify_thread_kill.get_value() == 0) { struct inotify_event *event = (struct inotify_event *) &buf[i]; if (event->len) { MTPD("inotify event: wd: %i, mask: %x, name: %s\n", event->wd, event->mask, event->name); -- cgit v1.2.3