From: Niklas Söderlund Date: Wed, 12 Jun 2019 23:45:42 +0000 (-0400) Subject: media: rcar-vin: Allow interrupting lock when trying to open the video device X-Git-Tag: v5.3-rc1~170^2~125 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=11492ee7cbfec989caf319bc299f0004b8a23e01;p=thirdparty%2Fkernel%2Flinux.git media: rcar-vin: Allow interrupting lock when trying to open the video device The user should be allowed to break waiting for the lock when opening the video device. Signed-off-by: Niklas Söderlund Reviewed-by: Ulrich Hecht Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index 0841f1a0bfd7b..f67cef97b89a3 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -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;