summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2022-02-01 14:00:16 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-02-17 10:00:21 +0100
commitcc74074ad9369ef54ba5d3b45edc28e9677911e7 (patch)
tree62182189cba2433b2b381f98ec7e252136e7dbce /drivers
parent24e9edc1527c48dbb42267de5b302414521c05d8 (diff)
media: i2c: ov08d10: Unlock on error in ov08d10_enum_frame_size()
This error path needs to drop the mutex to avoid a deadlock. Fixes: 7be91e02ed57 ("media: i2c: Add ov08d10 camera sensor driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/i2c/ov08d10.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/i2c/ov08d10.c b/drivers/media/i2c/ov08d10.c
index 1f42dd714ef6..e5ef6466a3ec 100644
--- a/drivers/media/i2c/ov08d10.c
+++ b/drivers/media/i2c/ov08d10.c
@@ -1264,8 +1264,10 @@ static int ov08d10_enum_frame_size(struct v4l2_subdev *sd,
return -EINVAL;
mutex_lock(&ov08d10->mutex);
- if (fse->code != ov08d10_get_format_code(ov08d10))
+ if (fse->code != ov08d10_get_format_code(ov08d10)) {
+ mutex_unlock(&ov08d10->mutex);
return -EINVAL;
+ }
mutex_unlock(&ov08d10->mutex);
fse->min_width = ov08d10->priv_lane->sp_modes[fse->index].width;