Page MenuHomeFreeBSD

kldxref: Refactor PNP entry parsing, no functional change
ClosedPublic

Authored by jhb on Dec 7 2023, 7:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 2 2024, 7:16 PM
Unknown Object (File)
Oct 2 2024, 9:05 AM
Unknown Object (File)
Oct 1 2024, 5:08 PM
Unknown Object (File)
Sep 28 2024, 12:27 AM
Unknown Object (File)
Sep 20 2024, 4:43 PM
Unknown Object (File)
Sep 16 2024, 5:47 AM
Unknown Object (File)
Sep 11 2024, 8:41 AM
Unknown Object (File)
Sep 5 2024, 10:28 PM
Subscribers
None

Details

Summary
  • Add a free_pnp_list to complement parse_pnp_list. Add freeing of 'new_desc' which was previously leaked.
  • Move body of loop that checked a single pnp list element against a table entry into a parse_pnp_entry function to reduce indentation and split parse_entry into a smaller function.
  • Similarly, split out a record_pnp_info function from parse_entry which builds the pnp_list and walks a table.

Sponsored by: DARPA

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 54854
Build 51743: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Dec 7 2023, 7:57 PM
jhb created this revision.
jhb added a parent revision: D42964: Stop #defining FREEBSD_ELF.
usr.sbin/kldxref/kldxref.c
495

Leaks new_descr?

usr.sbin/kldxref/kldxref.c
495

Yes, in fact it should just call free_pnp_list().

Seems good to me now.

This revision is now accepted and ready to land.Dec 11 2023, 2:53 AM