From f397c25acfc430e72d69f823cdc673e599f2ba40 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Sun, 5 Oct 2008 09:17:05 +0000 Subject: Fix a possible deadlock if the album art loading fails git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18711 a1c6a512-1295-4272-9138-f99709370657 --- apps/buffering.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/buffering.c b/apps/buffering.c index e39a4b6eca..a821e7f8c7 100644 --- a/apps/buffering.c +++ b/apps/buffering.c @@ -944,11 +944,11 @@ int bufopen(const char *file, size_t offset, enum data_type type) int rc; mutex_lock(&llist_mutex); /* Lock because load_bitmap yields */ rc = load_bitmap(fd); + mutex_unlock(&llist_mutex); if (rc <= 0) { rm_handle(h); close(fd); - mutex_unlock(&llist_mutex); return ERR_FILE_ERROR; } h->filerem = 0; @@ -956,7 +956,6 @@ int bufopen(const char *file, size_t offset, enum data_type type) h->available = rc; h->widx = buf_widx + rc; /* safe because the data doesn't wrap */ buf_widx += rc; /* safe too */ - mutex_unlock(&llist_mutex); } else #endif -- cgit v1.2.3