diff options
author | Logan Gunthorpe <logang@deltatee.com> | 2023-03-01 21:41:29 +0100 |
---|---|---|
committer | Jes Sorensen <jes@trained-monkey.org> | 2023-03-13 15:08:10 +0100 |
commit | ba867e2ebaead20e3d9a7e62ef8fd940176c3110 (patch) | |
tree | 5af92654bf3c58e24337e82bd06d3a122c470e38 /Create.c | |
parent | super-ddf.c: fix memleak in get_vd_num_of_subarray() (diff) | |
download | mdadm-ba867e2ebaead20e3d9a7e62ef8fd940176c3110.tar.xz mdadm-ba867e2ebaead20e3d9a7e62ef8fd940176c3110.zip |
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>
Acked-by: Kinga Tanska <kinga.tanska@linux.intel.com>
Reviewed-by: Xiao Ni <xni@redhat.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Acked-by: Coly Li <colyli@suse.de>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
Diffstat (limited to 'Create.c')
-rw-r--r-- | Create.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); } |