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>
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;