diff --git a/drivers/aufs/aufs.go b/drivers/aufs/aufs.go index 8d001a89ee..ef90f5f16c 100644 --- a/drivers/aufs/aufs.go +++ b/drivers/aufs/aufs.go @@ -679,10 +679,11 @@ func (a *Driver) Cleanup() error { } func (a *Driver) aufsMount(ro []string, rw, target string, options graphdriver.MountOpts) (err error) { - defer func() { + defer func() error { if err != nil { - Unmount(target) + err = Unmount(target) } + return err }() // Mount options are clipped to page size(4096 bytes). If there are more