Commit f6d8c8bb authored by Julia Lawall's avatar Julia Lawall Committed by Benjamin Herrenschmidt

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: default avatarJulia Lawall <julia@diku.dk>
Acked-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 43caa61f
...@@ -645,8 +645,10 @@ void vio_cmo_set_dev_desired(struct vio_dev *viodev, size_t desired) ...@@ -645,8 +645,10 @@ void vio_cmo_set_dev_desired(struct vio_dev *viodev, size_t desired)
found = 1; found = 1;
break; break;
} }
if (!found) if (!found) {
spin_unlock_irqrestore(&vio_cmo.lock, flags);
return; return;
}
/* Increase/decrease in desired device entitlement */ /* Increase/decrease in desired device entitlement */
if (desired >= viodev->cmo.desired) { if (desired >= viodev->cmo.desired) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment