media: rcar-vin: Allow interrupting lock when trying to open the video device
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Wed, 12 Jun 2019 23:45:42 +0000 (19:45 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 21 Jun 2019 20:40:44 +0000 (16:40 -0400)
The user should be allowed to break waiting for the lock when opening
the video device.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/rcar-vin/rcar-v4l2.c

index 0841f1a0bfd7ba3a3722d6f8465564e0478845e1..f67cef97b89a3bd451d30652a25dcc412d84f83c 100644 (file)
@@ -821,7 +821,9 @@ static int rvin_open(struct file *file)
        struct rvin_dev *vin = video_drvdata(file);
        int ret;
 
-       mutex_lock(&vin->lock);
+       ret = mutex_lock_interruptible(&vin->lock);
+       if (ret)
+               return ret;
 
        file->private_data = vin;