diff options
author | Julia Lawall <julia@diku.dk> | 2010-03-29 01:33:34 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-04-07 04:00:43 -0400 |
commit | f6d8c8bb1d360272d795927d39f3d2c5934e77d9 (patch) | |
tree | da15e76aa8e9135fed852f26a7d0161a73c7f202 /arch/powerpc/kernel/vio.c | |
parent | 43caa61f154da85a620965f3f61c2f45366d8dc7 (diff) |
powerpc/vio: Add missing unlock in error path
Add an unlock before exiting the function.
A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r exists@
expression E1;
identifier f;
@@
f (...) { <+...
* spin_lock_irq (E1,...);
... when != E1
* return ...;
...+> }
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/vio.c')
-rw-r--r-- | arch/powerpc/kernel/vio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index 2f57956714bd..2a3428bef83a 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -645,8 +645,10 @@ void vio_cmo_set_dev_desired(struct vio_dev *viodev, size_t desired) | |||
645 | found = 1; | 645 | found = 1; |
646 | break; | 646 | break; |
647 | } | 647 | } |
648 | if (!found) | 648 | if (!found) { |
649 | spin_unlock_irqrestore(&vio_cmo.lock, flags); | ||
649 | return; | 650 | return; |
651 | } | ||
650 | 652 | ||
651 | /* Increase/decrease in desired device entitlement */ | 653 | /* Increase/decrease in desired device entitlement */ |
652 | if (desired >= viodev->cmo.desired) { | 654 | if (desired >= viodev->cmo.desired) { |