diff options
author | Julia Lawall <julia@diku.dk> | 2008-07-21 03:57:26 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-07-30 17:23:39 -0400 |
commit | 68905eb4dc9c691ba09df767ac0641395025cef6 (patch) | |
tree | 23cddfc767f374bf980a157d492f2e682c9a4b05 /drivers | |
parent | b0ca2a21f769ae255bd6821cbc5af8af797f1da7 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 0920b796bd78..b70c5314f537 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -2937,9 +2937,9 @@ static void ehea_rereg_mrs(struct work_struct *work) | |||
2937 | } | 2937 | } |
2938 | } | 2938 | } |
2939 | } | 2939 | } |
2940 | mutex_unlock(&dlpar_mem_lock); | 2940 | ehea_info("re-initializing driver complete"); |
2941 | ehea_info("re-initializing driver complete"); | ||
2942 | out: | 2941 | out: |
2942 | mutex_unlock(&dlpar_mem_lock); | ||
2943 | return; | 2943 | return; |
2944 | } | 2944 | } |
2945 | 2945 | ||