提交 a5c330fe 编写于 作者: M Martyn Welch 提交者: Greg Kroah-Hartman

staging: vme: Fix mutex locking

Fix incorrect use of mutex_trylock().
Signed-off-by: NMartyn Welch <martyn.welch@gefanuc.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 58e50798
...@@ -879,7 +879,7 @@ int vme_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src, ...@@ -879,7 +879,7 @@ int vme_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
return -EINVAL; return -EINVAL;
} }
if (mutex_trylock(&(list->mtx))) { if (!mutex_trylock(&(list->mtx))) {
printk("Link List already submitted\n"); printk("Link List already submitted\n");
return -EINVAL; return -EINVAL;
} }
...@@ -922,7 +922,7 @@ int vme_dma_list_free(struct vme_dma_list *list) ...@@ -922,7 +922,7 @@ int vme_dma_list_free(struct vme_dma_list *list)
return -EINVAL; return -EINVAL;
} }
if (mutex_trylock(&(list->mtx))) { if (!mutex_trylock(&(list->mtx))) {
printk("Link List in use\n"); printk("Link List in use\n");
return -EINVAL; return -EINVAL;
} }
...@@ -955,7 +955,7 @@ int vme_dma_free(struct vme_resource *resource) ...@@ -955,7 +955,7 @@ int vme_dma_free(struct vme_resource *resource)
ctrlr = list_entry(resource->entry, struct vme_dma_resource, list); 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"); printk("Resource busy, can't free\n");
return -EBUSY; return -EBUSY;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册