diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 399cc64d8e3f485785bab1e73b2add2eea1ae9d8..5f1517bcc33d390bf9b8508552cb93511a50d2ed 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -2558,7 +2558,7 @@ class LURenameInstance(LogicalUnit):
 
     self.cfg.RenameInstance(inst.name, self.op.new_name)
     # Change the instance lock. This is definitely safe while we hold the BGL
-    self.context.glm.remove(locking.LEVEL_INSTANCE, inst.name)
+    self.context.glm.remove(locking.LEVEL_INSTANCE, old_name)
     self.context.glm.add(locking.LEVEL_INSTANCE, self.op.new_name)
 
     # re-read the instance from the configuration after rename