aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartyn Welch <martyn.welch@gefanuc.com>2009-10-29 16:35:27 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 12:23:18 -0800
commita5c330fe8b2f1e17133190e0b297a710c5a4de04 (patch)
tree35dee52cf4e500101f9267984a8e17ce416f77fc
parent58e507987b285f3df99f839c79da3985555ac220 (diff)
staging: vme: Fix mutex locking
Fix incorrect use of mutex_trylock(). Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/vme/vme.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index ca9e4de4614..994fdb9b212 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -879,7 +879,7 @@ int vme_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
return -EINVAL;
}
- if (mutex_trylock(&(list->mtx))) {
+ if (!mutex_trylock(&(list->mtx))) {
printk("Link List already submitted\n");
return -EINVAL;
}
@@ -922,7 +922,7 @@ int vme_dma_list_free(struct vme_dma_list *list)
return -EINVAL;
}
- if (mutex_trylock(&(list->mtx))) {
+ if (!mutex_trylock(&(list->mtx))) {
printk("Link List in use\n");
return -EINVAL;
}
@@ -955,7 +955,7 @@ int vme_dma_free(struct vme_resource *resource)
ctrlr = list_entry(resource->entry, struct vme_dma_resource, list);
- if (mutex_trylock(&(ctrlr->mtx))) {
+ if (!mutex_trylock(&(ctrlr->mtx))) {
printk("Resource busy, can't free\n");
return -EBUSY;
}