devices/loopback: close loop device controller

In the `close` method of the device also close the loop controller.
This commit is contained in:
Christian Kellner 2021-08-03 12:33:38 +02:00 committed by Tom Gundersen
parent 82ecc530a1
commit 3d08e84ceb

View file

@ -127,6 +127,10 @@ class LoopbackService(devices.DeviceService):
return res
def close(self):
# Calling `close` is valid on closed
# `LoopControl` and `Loop` objects
self.ctl.close()
if self.lo:
self.lo.close()
self.lo = None