mdadm/0062-Create-goto-abort_locked-instead-of-return-1-in-erro.patch

32 lines
909 B
Diff
Raw Normal View History

From 75f23f662fdfd6709be3d1d554d435cc0aa33443 Mon Sep 17 00:00:00 2001
From: Logan Gunthorpe <logang@deltatee.com>
Date: Wed, 21 Sep 2022 14:43:50 -0600
Subject: [PATCH 62/63] Create: goto abort_locked instead of return 1 in error
path
The return 1 after the fstat_is_blkdev() check should be replaced
with an error return that goes through the error path to unlock
resources locked by this function.
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
---
Create.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Create.c b/Create.c
index 953e7372..2e8203ec 100644
--- a/Create.c
+++ b/Create.c
@@ -939,7 +939,7 @@ int Create(struct supertype *st, char *mddev,
goto abort_locked;
}
if (!fstat_is_blkdev(fd, dv->devname, &rdev))
- return 1;
+ goto abort_locked;
inf->disk.major = major(rdev);
inf->disk.minor = minor(rdev);
}
--
2.38.1