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, Jan 18, 7:20 AM
Unknown Object (File)
Sat, Jan 18, 5:48 AM
Unknown Object (File)
Dec 19 2024, 10:14 PM
Unknown Object (File)
Nov 30 2024, 11:41 PM
Unknown Object (File)
Nov 16 2024, 4:36 PM
Unknown Object (File)
Nov 10 2024, 11:10 PM
Unknown Object (File)
Oct 20 2024, 1:34 AM
Unknown Object (File)
Oct 20 2024, 1:34 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 52308
Build 49199: arc lint + arc unit

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.