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, May 18, 7:29 PM
Unknown Object (File)
Fri, May 17, 6:04 AM
Unknown Object (File)
Fri, May 17, 6:02 AM
Unknown Object (File)
Fri, May 17, 6:02 AM
Unknown Object (File)
Wed, May 15, 10:01 AM
Unknown Object (File)
Sun, May 12, 7:03 PM
Unknown Object (File)
Apr 10 2024, 1:50 AM
Unknown Object (File)
Apr 10 2024, 1:48 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 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.