HomeFreeBSD

kern: mountroot: avoid fd leak in .md parsing

Description

kern: mountroot: avoid fd leak in .md parsing

parse_dir_md() opens /dev/mdctl but only closes the resulting fd on
success, not upon failure of the ioctl or when we exceed the md unit
max.

Reviewed by: kib (slightly previous version)
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
X-NetApp-PR: #62
Differential Revision: https://reviews.freebsd.org/D31229

Details

Provenance
kevansAuthored on Jul 20 2021, 10:23 AM
Reviewer
kib
Differential Revision
D31229: kern: mountroot: avoid fd leak in .md parsing
Parents
rGfa46a46a8249: arm64: Print CPU features slightly earlier
Branches
Unknown
Tags
Unknown