Merge branch 'linus' into patchwork
* linus: (1465 commits) ARM: tegra30: clocks: Fix pciex clock registration lseek(fd, n, SEEK_END) does *not* go to eof - n Linux 3.10-rc6 smp.h: Use local_irq_{save,restore}() in !SMP version of on_each_cpu(). powerpc: Fix missing/delayed calls to irq_work powerpc: Fix emulation of illegal instructions on PowerNV platform powerpc: Fix stack overflow crash in resume_kernel when ftracing snd_pcm_link(): fix a leak... use can_lookup() instead of direct checks of ->i_op->lookup move exit_task_namespaces() outside of exit_notify() fput: task_work_add() can fail if the caller has passed exit_task_work() xfs: don't shutdown log recovery on validation errors xfs: ensure btree root split sets blkno correctly xfs: fix implicit padding in directory and attr CRC formats xfs: don't emit v5 superblock warnings on write mei: me: clear interrupts on the resume path mei: nfc: fix nfc device freeing mei: init: Flush scheduled work before resetting the device sctp: fully initialize sctp_outq in sctp_outq_init netiucv: Hold rtnl between name allocation and device registration. ...
Dieser Commit ist enthalten in:
@@ -176,7 +176,7 @@ struct zoran_fh;
|
||||
|
||||
struct zoran_mapping {
|
||||
struct zoran_fh *fh;
|
||||
int count;
|
||||
atomic_t count;
|
||||
};
|
||||
|
||||
struct zoran_buffer {
|
||||
|
@@ -2780,8 +2780,7 @@ static void
|
||||
zoran_vm_open (struct vm_area_struct *vma)
|
||||
{
|
||||
struct zoran_mapping *map = vma->vm_private_data;
|
||||
|
||||
map->count++;
|
||||
atomic_inc(&map->count);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2792,7 +2791,7 @@ zoran_vm_close (struct vm_area_struct *vma)
|
||||
struct zoran *zr = fh->zr;
|
||||
int i;
|
||||
|
||||
if (--map->count > 0)
|
||||
if (!atomic_dec_and_mutex_lock(&map->count, &zr->resource_lock))
|
||||
return;
|
||||
|
||||
dprintk(3, KERN_INFO "%s: %s - munmap(%s)\n", ZR_DEVNAME(zr),
|
||||
@@ -2805,14 +2804,16 @@ zoran_vm_close (struct vm_area_struct *vma)
|
||||
kfree(map);
|
||||
|
||||
/* Any buffers still mapped? */
|
||||
for (i = 0; i < fh->buffers.num_buffers; i++)
|
||||
if (fh->buffers.buffer[i].map)
|
||||
for (i = 0; i < fh->buffers.num_buffers; i++) {
|
||||
if (fh->buffers.buffer[i].map) {
|
||||
mutex_unlock(&zr->resource_lock);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
dprintk(3, KERN_INFO "%s: %s - free %s buffers\n", ZR_DEVNAME(zr),
|
||||
__func__, mode_name(fh->map_mode));
|
||||
|
||||
mutex_lock(&zr->resource_lock);
|
||||
|
||||
if (fh->map_mode == ZORAN_MAP_MODE_RAW) {
|
||||
if (fh->buffers.active != ZORAN_FREE) {
|
||||
@@ -2916,7 +2917,7 @@ zoran_mmap (struct file *file,
|
||||
goto mmap_unlock_and_return;
|
||||
}
|
||||
map->fh = fh;
|
||||
map->count = 1;
|
||||
atomic_set(&map->count, 1);
|
||||
|
||||
vma->vm_ops = &zoran_vm_ops;
|
||||
vma->vm_flags |= VM_DONTEXPAND;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren