aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core/videobuf-dma-contig.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-18 08:09:40 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-18 08:09:40 -0800
commitba4b60e85d6c5fc2242fd24e131a47fb922e5d89 (patch)
tree6be918ce3924d0677bc1029f7d1255fef48a8f85 /drivers/media/v4l2-core/videobuf-dma-contig.c
parentDrivers: hv: Ballon: Make pressure posting thread sleep interruptibly (diff)
parentLinux 3.14-rc3 (diff)
downloadlinux-dev-ba4b60e85d6c5fc2242fd24e131a47fb922e5d89.tar.xz
linux-dev-ba4b60e85d6c5fc2242fd24e131a47fb922e5d89.zip
Merge 3.14-rc3 into char-misc-next
We need the fixes here for future mei and other patches. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/media/v4l2-core/videobuf-dma-contig.c')
-rw-r--r--drivers/media/v4l2-core/videobuf-dma-contig.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/media/v4l2-core/videobuf-dma-contig.c b/drivers/media/v4l2-core/videobuf-dma-contig.c
index 65411adcd0ea..7e6b209b7002 100644
--- a/drivers/media/v4l2-core/videobuf-dma-contig.c
+++ b/drivers/media/v4l2-core/videobuf-dma-contig.c
@@ -66,14 +66,11 @@ static void __videobuf_dc_free(struct device *dev,
static void videobuf_vm_open(struct vm_area_struct *vma)
{
struct videobuf_mapping *map = vma->vm_private_data;
- struct videobuf_queue *q = map->q;
- dev_dbg(q->dev, "vm_open %p [count=%u,vma=%08lx-%08lx]\n",
+ dev_dbg(map->q->dev, "vm_open %p [count=%u,vma=%08lx-%08lx]\n",
map, map->count, vma->vm_start, vma->vm_end);
- videobuf_queue_lock(q);
map->count++;
- videobuf_queue_unlock(q);
}
static void videobuf_vm_close(struct vm_area_struct *vma)
@@ -85,11 +82,12 @@ static void videobuf_vm_close(struct vm_area_struct *vma)
dev_dbg(q->dev, "vm_close %p [count=%u,vma=%08lx-%08lx]\n",
map, map->count, vma->vm_start, vma->vm_end);
- videobuf_queue_lock(q);
- if (!--map->count) {
+ map->count--;
+ if (0 == map->count) {
struct videobuf_dma_contig_memory *mem;
dev_dbg(q->dev, "munmap %p q=%p\n", map, q);
+ videobuf_queue_lock(q);
/* We need first to cancel streams, before unmapping */
if (q->streaming)
@@ -128,8 +126,8 @@ static void videobuf_vm_close(struct vm_area_struct *vma)
kfree(map);
+ videobuf_queue_unlock(q);
}
- videobuf_queue_unlock(q);
}
static const struct vm_operations_struct videobuf_vm_ops = {