Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[media] s5p-fimc: Don't use mutex_lock_interruptible() in device release()

Use uninterruptible mutex_lock in the release() file op to make
sure all resources are properly freed when a process is being
terminated. Returning -ERESTARTSYS has no effect for a terminating
process and this caused driver resources not to be released. Not
releasing the buffer queue also prevented other drivers to free
memory, e.g. in MMAP -> USERPTR scenario.
This patch is required for stable kernels v3.6+.

Reported-by: Kamil Debski <k.debski@samsung.com>
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Sylwester Nawrocki and committed by
Mauro Carvalho Chehab
ba6b372c 97d66c47

+2 -4
+1 -2
drivers/media/platform/s5p-fimc/fimc-capture.c
··· 556 556 557 557 dbg("pid: %d, state: 0x%lx", task_pid_nr(current), fimc->state); 558 558 559 - if (mutex_lock_interruptible(&fimc->lock)) 560 - return -ERESTARTSYS; 559 + mutex_lock(&fimc->lock); 561 560 562 561 if (--fimc->vid_cap.refcnt == 0) { 563 562 clear_bit(ST_CAPT_BUSY, &fimc->state);
+1 -2
drivers/media/platform/s5p-fimc/fimc-m2m.c
··· 718 718 dbg("pid: %d, state: 0x%lx, refcnt= %d", 719 719 task_pid_nr(current), fimc->state, fimc->m2m.refcnt); 720 720 721 - if (mutex_lock_interruptible(&fimc->lock)) 722 - return -ERESTARTSYS; 721 + mutex_lock(&fimc->lock); 723 722 724 723 v4l2_m2m_ctx_release(ctx->m2m_ctx); 725 724 fimc_ctrls_delete(ctx);