mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
devmapper: Fix UnmountDevice for non-existing device
Properly error out if passed an id that doesn't exist. Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
This commit is contained in:
parent
2c82fd93d8
commit
304e33a2fe
1 changed files with 3 additions and 0 deletions
|
@ -847,6 +847,9 @@ func (devices *DeviceSet) UnmountDevice(hash string, mode UnmountMode) error {
|
|||
defer devices.Unlock()
|
||||
|
||||
info := devices.Devices[hash]
|
||||
if info == nil {
|
||||
return fmt.Errorf("UnmountDevice: no such device %s\n", hash)
|
||||
}
|
||||
|
||||
if mode == UnmountFloat {
|
||||
if info.floating {
|
||||
|
|
Loading…
Add table
Reference in a new issue