]> err.no Git - linux-2.6/commit
drivers/net/ehea/ehea_main.c: Release mutex in error handling code
authorJulia Lawall <julia@diku.dk>
Mon, 21 Jul 2008 07:57:26 +0000 (09:57 +0200)
committerJeff Garzik <jgarzik@redhat.com>
Wed, 30 Jul 2008 21:23:39 +0000 (17:23 -0400)
commit68905eb4dc9c691ba09df767ac0641395025cef6
tree23cddfc767f374bf980a157d492f2e682c9a4b05
parentb0ca2a21f769ae255bd6821cbc5af8af797f1da7
drivers/net/ehea/ehea_main.c: Release mutex in error handling code

The mutex is released on a successful return, so it would seem that it
should be released on an error return as well.

The semantic patch finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression l;
@@

mutex_lock(l);
... when != mutex_unlock(l)
    when any
    when strict
(
if (...) { ... when != mutex_unlock(l)
+   mutex_unlock(l);
    return ...;
}
|
mutex_unlock(l);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/ehea/ehea_main.c