Index: /trunk/src/VBox/Main/src-server/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 54173)
+++ /trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 54174)
@@ -11091,4 +11091,7 @@
                 llMedia.push_back(pMedium);
                 ComObjPtr<Medium> pParent = pMedium->i_getParent();
+                /* Not allowed to keep this lock as below we need the parent
+                 * medium lock, and the lock order is parent to child. */
+                lock.release();
                 /*
                  * Search for medias which are not attached to any machine, but
