Page MenuHomeFreeBSD

bsdinstall: Handle errors from geom_gettree.
ClosedPublic

Authored by jhb on Jun 27 2023, 11:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 19, 12:23 AM
Unknown Object (File)
Wed, Apr 16, 2:32 PM
Unknown Object (File)
Sat, Apr 12, 4:33 PM
Unknown Object (File)
Fri, Apr 11, 5:39 PM
Unknown Object (File)
Fri, Mar 28, 9:32 AM
Unknown Object (File)
Feb 10 2025, 7:01 PM
Unknown Object (File)
Feb 9 2025, 7:53 PM
Unknown Object (File)
Feb 9 2025, 7:13 PM
Subscribers

Details

Summary

geom_gettree probably never fails, and if it does there isn't much of
a fallback other than aborting partitioning. However, a few places
were checking the return value and not doing anything with it
triggering a unused-but-set-variable warning. Checking the errors
resolves the warning.

While here, check for errors in other places that weren't checking for
them at all, remove a spurious double call (the second call overwrote
the mesh structure leaking all the pointers from the first), and close
a few resource leaks on error paths.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Jun 27 2023, 11:11 PM

Hmmm... Yea, if it does fail, I'm not sure what F'd up state we'll be in, but this is better than nothing.

This revision is now accepted and ready to land.Jun 27 2023, 11:23 PM
usr.sbin/bsdinstall/partedit/part_wizard.c
90

Eh, probably need a free(schemeroot) for this error return path.

This revision now requires review to proceed.Jun 28 2023, 12:50 AM
This revision is now accepted and ready to land.Jun 28 2023, 12:54 AM
This revision was automatically updated to reflect the committed changes.