From 7f3613cc6e3f255d9d72c30eba45ee22c42be9c5 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Thu, 28 Apr 2016 21:29:51 +0000 Subject: [PATCH] Remove some deferring --- builtin/logical/transit/lock_manager.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/logical/transit/lock_manager.go b/builtin/logical/transit/lock_manager.go index ad53482af..bd817ed3e 100644 --- a/builtin/logical/transit/lock_manager.go +++ b/builtin/logical/transit/lock_manager.go @@ -217,12 +217,12 @@ func (lm *lockManager) getPolicyCommon(storage logical.Storage, name string, ups // Reload the policy with the write lock to ensure we still need the upgrade p, err = lm.getStoredPolicy(storage, name) if err != nil { - defer lm.UnlockPolicy(name, exclusive) + lm.UnlockPolicy(name, exclusive) return } if p == nil { - defer lm.UnlockPolicy(name, exclusive) err = fmt.Errorf("error reloading policy for upgrade") + lm.UnlockPolicy(name, exclusive) return } @@ -300,7 +300,7 @@ func (lm *lockManager) RefreshPolicy(storage logical.Storage, name string) (p *P p, err = lm.getStoredPolicy(storage, name) if err != nil { - defer lm.UnlockPolicy(name, exclusive) + lm.UnlockPolicy(name, exclusive) return }