From: Logan Gunthorpe Date: Wed, 1 Mar 2023 20:41:29 +0000 (-0700) Subject: Create: goto abort_locked instead of return 1 in error path X-Git-Tag: mdadm-4.3~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba867e2ebaead20e3d9a7e62ef8fd940176c3110;p=thirdparty%2Fmdadm.git 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 Acked-by: Kinga Tanska Reviewed-by: Xiao Ni Reviewed-by: Chaitanya Kulkarni Acked-by: Coly Li Signed-off-by: Jes Sorensen --- 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); }