summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2008-10-05 09:17:05 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2008-10-05 09:17:05 +0000
commitf397c25acfc430e72d69f823cdc673e599f2ba40 (patch)
tree6558d3654331c9dbfe9fe50465c6ce1c653b9307
parent5b3627f7fbd7e9a7479a2abb01df6dd6e2cd278b (diff)
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
-rw-r--r--apps/buffering.c3
1 files changed, 1 insertions, 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