From 86e4754ac8fde9a9c913571016bc31257aa2e195 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Mon, 29 Mar 2010 05:34:46 +0000 Subject: powerpc/pmac: Add missing unlocks in error path In some error handling cases the lock is not unlocked. A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ expression E1; identifier f; @@ f (...) { <+... * spin_lock_irqsave (E1,...); ... when != E1 * return ...; ...+> } // Signed-off-by: Julia Lawall Signed-off-by: Benjamin Herrenschmidt --- drivers/macintosh/macio-adb.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/macintosh/macio-adb.c') diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c index 79119f56e82d..bd6da7a9c55b 100644 --- a/drivers/macintosh/macio-adb.c +++ b/drivers/macintosh/macio-adb.c @@ -155,6 +155,7 @@ static int macio_adb_reset_bus(void) while ((in_8(&adb->ctrl.r) & ADB_RST) != 0) { if (--timeout == 0) { out_8(&adb->ctrl.r, in_8(&adb->ctrl.r) & ~ADB_RST); + spin_unlock_irqrestore(&macio_lock, flags); return -1; } } -- cgit v1.2.3