From 23065d11f7fa0eeb828ccad356878a8ce446beb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Rod=C3=A1k?= Date: Wed, 3 Jul 2024 14:15:24 +0200 Subject: [PATCH] Fix errcheck: error return value of `aufs.Unmount` is not checked MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Rodák --- drivers/aufs/aufs.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/aufs/aufs.go b/drivers/aufs/aufs.go index 8d001a89ee..56f48ad205 100644 --- a/drivers/aufs/aufs.go +++ b/drivers/aufs/aufs.go @@ -679,10 +679,13 @@ 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) + if err1 := Unmount(target); err1 != nil { + logrus.Warnf("Unmount %s: %v", target, err1) + } } + return err }() // Mount options are clipped to page size(4096 bytes). If there are more