From: Sylwester Nawrocki Date: Sat, 21 Apr 2012 21:46:30 +0000 (-0300) Subject: media: s5p-fimc: Fix locking in subdev set_crop op X-Git-Tag: v3.3.7~37 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=817a2eb566911b127a57cf3561bb88c98e4b6348;p=karo-tx-linux.git media: s5p-fimc: Fix locking in subdev set_crop op commit e985dbf7d93e2a3e114b4525413e50f83613e0cb upstream. When setting TRY crop on the sub-device the mutex was erroneously acquired rather than released on exit path. This bug is present in kernels starting from v3.2. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c index a9e9653beeb4..8dab7fd81fd5 100644 --- a/drivers/media/video/s5p-fimc/fimc-capture.c +++ b/drivers/media/video/s5p-fimc/fimc-capture.c @@ -1316,7 +1316,7 @@ static int fimc_subdev_set_crop(struct v4l2_subdev *sd, fimc_capture_try_crop(ctx, r, crop->pad); if (crop->which == V4L2_SUBDEV_FORMAT_TRY) { - mutex_lock(&fimc->lock); + mutex_unlock(&fimc->lock); *v4l2_subdev_get_try_crop(fh, crop->pad) = *r; return 0; }