aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-06-29 00:42:53 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-02 14:01:02 -0400
commit4c61f678a468768afd45c3d9ac697f8f55aa04eb (patch)
treef8888ca8a6098dfb051c8ef1d684d879b12ebfb7 /drivers/media/video/pvrusb2
parenta3b1dc95578fd0b524139689a9e0f148a622eb24 (diff)
V4L/DVB: drivers/media/video/pvrusb2: Add missing mutex_unlock
Add a mutex_unlock missing on the error path. In the other functions in the same file the locks and unlocks of this mutex appear to be balanced, so it would seem that the same should hold in this case. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression E1; @@ * mutex_lock(E1,...); <+... when != E1 if (...) { ... when != E1 * return ...; } ...+> * mutex_unlock(E1,...); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pvrusb2')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-ioread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-ioread.c b/drivers/media/video/pvrusb2/pvrusb2-ioread.c
index b4824782d858..bba6115c9ae8 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-ioread.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-ioread.c
@@ -223,7 +223,10 @@ int pvr2_ioread_setup(struct pvr2_ioread *cp,struct pvr2_stream *sp)
223 " pvr2_ioread_setup (setup) id=%p",cp); 223 " pvr2_ioread_setup (setup) id=%p",cp);
224 pvr2_stream_kill(sp); 224 pvr2_stream_kill(sp);
225 ret = pvr2_stream_set_buffer_count(sp,BUFFER_COUNT); 225 ret = pvr2_stream_set_buffer_count(sp,BUFFER_COUNT);
226 if (ret < 0) return ret; 226 if (ret < 0) {
227 mutex_unlock(&cp->mutex);
228 return ret;
229 }
227 for (idx = 0; idx < BUFFER_COUNT; idx++) { 230 for (idx = 0; idx < BUFFER_COUNT; idx++) {
228 bp = pvr2_stream_get_buffer(sp,idx); 231 bp = pvr2_stream_get_buffer(sp,idx);
229 pvr2_buffer_set_buffer(bp, 232 pvr2_buffer_set_buffer(bp,