Skip to contentSkip to conversation

V4L/DVB: unlock on error path

PATCH In review Dan Carpenter 2 participants 2 messages Aug 12, 2010 – Aug 19, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 V4L/DVB: unlock on error path

If we return directly here then we miss out on some mutex_unlock()s

drivers/media/video/s5p-fimc/fimc-core.c +2 -1
index b151c7b..1beb226 100644
@@ -822,7 +822,8 @@ static int fimc_m2m_s_fmt(struct file *file, void *priv, struct v4l2_format *f)
 	} else {
 		v4l2_err(&ctx->fimc_dev->m2m.v4l2_dev,
 			 "Wrong buffer/video queue type (%d)\n", f->type);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto s_fmt_out;
 	}
 
 	pix = &f->fmt.pix;
Acked-by on v1 1/1
#1 lore raw

Thank you for catching this up. I had this fixed already, but due to hassle caused by having multiple versions of the driver this bug somehow made it unnoticed to mainline.

Quoted 28 lines

-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Thursday, August 12, 2010 9:42 AM
To: Mauro Carvalho Chehab
Cc: Pawel Osciak; Kyungmin Park; Sylwester Nawrocki; linux- [email protected]; [email protected]
Subject: [patch] V4L/DVB: unlock on error path

If we return directly here then we miss out on some mutex_unlock()s

drivers/media/video/s5p-fimc/fimc-core.c +2 -1
index b151c7b..1beb226 100644
@@ -822,7 +822,8 @@ static int fimc_m2m_s_fmt(struct file *file, void
 *priv, struct v4l2_format *f)
 	} else {
 		v4l2_err(&ctx->fimc_dev->m2m.v4l2_dev,
 			 "Wrong buffer/video queue type (%d)\n", f->type);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto s_fmt_out;
 	}
 

pix = &f->fmt.pix;