Page MenuHomeFreeBSD

bsdinstall: Handle errors from geom_gettree.
ClosedPublic

Authored by jhb on Jun 27 2023, 11:11 PM.
Tags
None
Referenced Files
F154511332: D40779.id123870.diff
Tue, Apr 28, 7:22 PM
F154508135: D40779.id123870.diff
Tue, Apr 28, 7:14 PM
Unknown Object (File)
Mon, Apr 27, 6:33 AM
Unknown Object (File)
Fri, Apr 24, 9:55 AM
Unknown Object (File)
Mon, Apr 20, 5:20 AM
Unknown Object (File)
Sat, Apr 18, 4:18 AM
Unknown Object (File)
Fri, Apr 17, 7:57 AM
Unknown Object (File)
Wed, Apr 15, 3:04 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 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.