From c8d15a5d13cea5a7b2d6a6ee634dfd17c83c8c13 Mon Sep 17 00:00:00 2001 From: Ananth N Mavinakayanahalli Date: Tue, 16 Jun 2015 16:26:12 +0530 Subject: Fix locking Release lock before bailing out. Signed-off-by: Ananth N Mavinakayanahalli V2: Handle the 2nd instance of the same issue in the file. Signed-off-by: Stewart Smith --- hw/lpc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'hw/lpc.c') diff --git a/hw/lpc.c b/hw/lpc.c index b287020..1eb2b58 100644 --- a/hw/lpc.c +++ b/hw/lpc.c @@ -343,10 +343,9 @@ static int64_t __lpc_write(uint32_t chip_id, enum OpalLPCAddressType addr_type, /* Perform OPB access */ rc = opb_write(chip, opb_base + addr, data, sz); - unlock(&chip->lpc_lock); - /* XXX Add LPC error handling/recovery */ bail: + unlock(&chip->lpc_lock); return rc; } @@ -403,10 +402,9 @@ static int64_t __lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type, /* Perform OPB access */ rc = opb_read(chip, opb_base + addr, data, sz); - unlock(&chip->lpc_lock); - /* XXX Add LPC error handling/recovery */ bail: + unlock(&chip->lpc_lock); return rc; } -- cgit v1.1