From: Dan Carpenter Date: Mon, 28 Dec 2009 16:59:46 +0000 (+0200) Subject: Staging: cx25821: fix double unlock in medusa_video_init() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7a02f549fcc30fe6be0c0024beae9a3db22e1af6;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Staging: cx25821: fix double unlock in medusa_video_init() medusa_set_videostandard() takes the lock but it always drops it before returning. This was found with a static checker and compile tested only. :/ Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/cx25821/cx25821-medusa-video.c b/drivers/staging/cx25821/cx25821-medusa-video.c index 1eb079b3d429..d6016200d699 100644 --- a/drivers/staging/cx25821/cx25821-medusa-video.c +++ b/drivers/staging/cx25821/cx25821-medusa-video.c @@ -795,10 +795,8 @@ int medusa_video_init(struct cx25821_dev *dev) value &= 0xFFFFFFDF; ret_val = cx25821_i2c_write(&dev->i2c_bus[0], MON_A_CTRL, value); - if (ret_val < 0) { - mutex_unlock(&dev->lock); + if (ret_val < 0) return -EINVAL; - } mutex_unlock(&dev->lock);