Thread (13 messages) 13 messages, 3 authors, 2022-09-30
STALE1382d
Revisions (4)
  1. v3 current
  2. v4 [diff vs current]
  3. v6 [diff vs current]
  4. v7 [diff vs current]

[PATCH mdadm v3 1/7] Create: goto abort_locked instead of return 1 in error path

From: Logan Gunthorpe <logang@deltatee.com>
Date: 2022-09-21 20:44:11
Subsystem: the rest · Maintainer: Linus Torvalds

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 e06ec2ae96a1..00479769920c 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.30.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help