From: Julia Lawall Date: Tue, 29 Jun 2010 04:42:53 +0000 (-0300) Subject: V4L/DVB: drivers/media/video/pvrusb2: Add missing mutex_unlock X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4c61f678a468768afd45c3d9ac697f8f55aa04eb;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git 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/) // @@ expression E1; @@ * mutex_lock(E1,...); <+... when != E1 if (...) { ... when != E1 * return ...; } ...+> * mutex_unlock(E1,...); // Signed-off-by: Julia Lawall Signed-off-by: Douglas Schilling Landgraf Signed-off-by: Mauro Carvalho Chehab --- 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) " pvr2_ioread_setup (setup) id=%p",cp); pvr2_stream_kill(sp); ret = pvr2_stream_set_buffer_count(sp,BUFFER_COUNT); - if (ret < 0) return ret; + if (ret < 0) { + mutex_unlock(&cp->mutex); + return ret; + } for (idx = 0; idx < BUFFER_COUNT; idx++) { bp = pvr2_stream_get_buffer(sp,idx); pvr2_buffer_set_buffer(bp,