Skip to content

Commit

Permalink
[media] fimc-lite: Don't use mutex_lock_interruptible() in device rel…
Browse files Browse the repository at this point in the history
…ease()

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 may cause driver resources not to be released.
This patch is required for stable kernels v3.5+.

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>
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Nov 26, 2012
1 parent ba6b372 commit ddc43d6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/media/platform/s5p-fimc/fimc-lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,7 @@ static int fimc_lite_close(struct file *file)
struct fimc_lite *fimc = video_drvdata(file);
int ret;

if (mutex_lock_interruptible(&fimc->lock))
return -ERESTARTSYS;
mutex_lock(&fimc->lock);

if (--fimc->ref_count == 0 && fimc->out_path == FIMC_IO_DMA) {
clear_bit(ST_FLITE_IN_USE, &fimc->state);
Expand Down

0 comments on commit ddc43d6

Please sign in to comment.